From 080784adc5e8cae1abe9fe77e2d65aa7f6f5af63 Mon Sep 17 00:00:00 2001 From: meadsteve Date: Mon, 25 Nov 2013 21:48:21 +0000 Subject: [PATCH] fix test expectations to be exact in phpunit --- Tests/PHPCI/Plugin/PHPUnitTest.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Tests/PHPCI/Plugin/PHPUnitTest.php b/Tests/PHPCI/Plugin/PHPUnitTest.php index e135cb81..211d06e2 100644 --- a/Tests/PHPCI/Plugin/PHPUnitTest.php +++ b/Tests/PHPCI/Plugin/PHPUnitTest.php @@ -134,19 +134,18 @@ class PHPUnitTest extends \PHPUnit_Framework_TestCase * @covers PHPUnit::execute * @covers PHPUnit::runDir */ - public function testExecute_CallsExecuteCommandManyTimesWhenGivenArrayDirectory( - ) + public function testExecute_CallsExecuteCommandManyTimesWhenGivenArrayDirectory() { chdir('/'); $this->loadPhpUnitWithOptions( array( - 'directory' => array(0, 1) + 'directory' => array("dir1", "dir2") ) ); - $this->mockCiBuilder->expects($this->at(0))->method("executeCommand"); - $this->mockCiBuilder->expects($this->at(1))->method("executeCommand"); + $this->expectFindBinaryToBeCalled($this->exactly(2)); + $this->expectExectuteCommandToBeCalled($this->exactly(2)); $returnValue = $this->testedPhpUnit->execute(); } @@ -161,12 +160,12 @@ class PHPUnitTest extends \PHPUnit_Framework_TestCase $this->loadPhpUnitWithOptions( array( - 'config' => array(0, 1) + 'config' => array("configfile1.xml", "configfile2.xml") ) ); - $this->mockCiBuilder->expects($this->at(0))->method("executeCommand"); - $this->mockCiBuilder->expects($this->at(1))->method("executeCommand"); + $this->expectFindBinaryToBeCalled($this->exactly(2)); + $this->expectExectuteCommandToBeCalled($this->exactly(2)); $returnValue = $this->testedPhpUnit->execute(); }