From 1ca8b9628ce5b90146bf3258e4ac17fcec1415b7 Mon Sep 17 00:00:00 2001 From: meadsteve Date: Fri, 6 Dec 2013 13:07:48 +0000 Subject: [PATCH] remove arguments from Executor test assertions that are not required. --- Tests/PHPCI/Plugin/Util/ExecutorTest.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Tests/PHPCI/Plugin/Util/ExecutorTest.php b/Tests/PHPCI/Plugin/Util/ExecutorTest.php index b551ebf4..694cdfa5 100644 --- a/Tests/PHPCI/Plugin/Util/ExecutorTest.php +++ b/Tests/PHPCI/Plugin/Util/ExecutorTest.php @@ -5,6 +5,7 @@ namespace PHPCI\Plugin\Tests\Util; require_once __DIR__ . "/ExamplePlugins.php"; use PHPCI\Plugin\Util\Executor; +use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTestCase; class ExecutorTest extends ProphecyTestCase @@ -56,14 +57,11 @@ class ExecutorTest extends ProphecyTestCase { $options = array(); $pluginName = 'PhpUnit'; - $pluginNamespace = 'PHPCI\\Plugin\\'; $mockPlugin = $this->prophesize('PHPCI\Plugin'); $mockPlugin->execute()->shouldBeCalledTimes(1); - $this->mockFactory->buildPlugin($pluginNamespace . $pluginName, $options) - ->shouldBeCalledTimes(1) - ->willReturn($mockPlugin->reveal()); + $this->mockFactory->buildPlugin(Argument::any(), Argument::any())->willReturn($mockPlugin->reveal()); $this->testedExecutor->executePlugin($pluginName, $options); } @@ -72,14 +70,13 @@ class ExecutorTest extends ProphecyTestCase { $options = array(); $pluginName = 'PhpUnit'; - $pluginNamespace = 'PHPCI\\Plugin\\'; $expectedReturnValue = true; $mockPlugin = $this->prophesize('PHPCI\Plugin'); $mockPlugin->execute()->willReturn($expectedReturnValue); - $this->mockFactory->buildPlugin($pluginNamespace . $pluginName, $options)->willReturn($mockPlugin->reveal()); + $this->mockFactory->buildPlugin(Argument::any(), Argument::any())->willReturn($mockPlugin->reveal()); $returnValue = $this->testedExecutor->executePlugin($pluginName, $options); @@ -90,7 +87,6 @@ class ExecutorTest extends ProphecyTestCase { $options = array(); $pluginName = 'DOESNTEXIST'; - $pluginNamespace = 'PHPCI\\Plugin\\'; $this->mockBuildLogger->logFailure('Plugin does not exist: ' . $pluginName)->shouldBeCalledTimes(1); @@ -101,14 +97,13 @@ class ExecutorTest extends ProphecyTestCase { $options = array(); $pluginName = 'PhpUnit'; - $pluginNamespace = 'PHPCI\\Plugin\\'; $expectedException = new \RuntimeException("Generic Error"); $mockPlugin = $this->prophesize('PHPCI\Plugin'); $mockPlugin->execute()->willThrow($expectedException); - $this->mockFactory->buildPlugin($pluginNamespace . $pluginName, $options)->willReturn($mockPlugin->reveal()); + $this->mockFactory->buildPlugin(Argument::any(), Argument::any())->willReturn($mockPlugin->reveal()); $this->mockBuildLogger->logFailure('EXCEPTION: ' . $expectedException->getMessage(), $expectedException) ->shouldBeCalledTimes(1);