/
ProjectTest.php
38 lines (28 loc) 路 1.09 KB
/
ProjectTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Idephix\Extension\Project;
use Idephix\Extension\Project\Project;
class ProjectTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->idx = $this->getMockBuilder('Idephix\Idephix')
->disableOriginalConstructor()
->getMock();
$this->idx->expects($this->exactly(1))
->method('local')
->will($this->returnArgument(0));
$this->idx->expects($this->exactly(1))
->method('getCurrentTarget')
->will($this->returnValue(array('ssh_params' => array('user' => 'kea'))));
$this->idx->expects($this->exactly(1))
->method('getCurrentTargetHost')
->will($this->returnValue('banana.com'));
$this->project = new Project();
$this->project->setIdephix($this->idx);
}
public function testRsyncProject()
{
$result = $this->project->rsyncProject('/a/remote');
$this->assertEquals("rsync -rlDcz --force --delete --progress -e 'ssh' ./ kea@banana.com:/a/remote/", $result);
}
}