Skip to content

Commit dd29580

Browse files
committed
Fix tests
1 parent ad134f9 commit dd29580

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

tests/Phpunit/DatabaseTestListenerTest.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,22 @@ public function testPhpcrTestSuite()
4242
$this->assertEquals(PHP_EOL.PHP_EOL.'[PHPCR]'.PHP_EOL, ob_get_clean());
4343
}
4444

45+
public function testFallsBackToOldInitDbalCommand()
46+
{
47+
$suite = $this->getMock('PHPUnit_Framework_TestSuite');
48+
$suite->expects($this->any())
49+
->method('getName')
50+
->will($this->returnValue('phpcr'));
51+
52+
$this->assertProcessExecuted(array('doctrine:phpcr:init:dbal', '--drop', '--force'), false);
53+
$this->assertProcessExecuted(array('doctrine:phpcr:init:dbal', '--drop'), true);
54+
$this->assertProcessExecuted(array('doctrine:phpcr:repository:init'));
55+
56+
ob_start();
57+
$this->listener->startTestSuite($suite);
58+
ob_end_clean();
59+
}
60+
4561
public function testOrmTestSuite()
4662
{
4763
$suite = $this->getMock('PHPUnit_Framework_TestSuite');
@@ -85,11 +101,7 @@ protected function assertProcessExecuted(array $arguments, $successfull = true)
85101
$process->expects($this->once())
86102
->method('run');
87103

88-
$process->expects($this->once())
89-
->method('isTerminated')
90-
->will($this->returnValue(true));
91-
92-
$process->expects($this->once())
104+
$process->expects($this->any())
93105
->method('isSuccessful')
94106
->will($this->returnValue($successfull));
95107

0 commit comments

Comments
 (0)