Modify __call() to pass array to execute().
[phpgit.git] / tests / GitTest.php
blob40da099a576269057565e0f0d4eedacc881cb950
1 <?php
3 Mock::generatePartial(
4 'Git',
5 'GitPartialMock',
6 array('execute'));
8 class GitTest extends UnitTestCase
10 protected $git;
12 public function setUp() {
13 $this->git = new GitPartialMock();
16 function testTransformArgs() {
17 $result = $this->git->transformArgs(array(
18 'v' => true,
19 's' => 'ours',
20 'no-commit' => true,
21 'message' => 'test'
22 ));
23 $expect = array(
24 '-v', '-sours', '--no-commit', '--message=test',
26 $this->assertIdentical($result, $expect);
29 function testCall() {
30 $git = new GitPartialMock();
31 $git->__construct('dir');
32 $git->expectOnce('execute', array(array('git', 'cherry-pick', '-s', 'f533ebca', '--no-commit')));
33 $git->setReturnValue('execute', $expect = 'Result');
34 $result = $git->cherryPick('f533ebca', array('--no-commit', 's' => true));
35 $this->assertIdentical($result, $expect);
38 // now, for the ported tests!
39 function testCallProcessCallsExecute() {
40 //$git = n