From c9afc27ab9ea62269967df14a80581ed51ba6c71 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 25 Sep 2018 16:46:37 +0200 Subject: Tests: Moved ServiceProvider::setExpects to TestCase --- tests/Unit/ServiceProviderTest.php | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'tests/Unit/ServiceProviderTest.php') diff --git a/tests/Unit/ServiceProviderTest.php b/tests/Unit/ServiceProviderTest.php index 149e28f8..ee5e3151 100644 --- a/tests/Unit/ServiceProviderTest.php +++ b/tests/Unit/ServiceProviderTest.php @@ -3,8 +3,6 @@ namespace Engelsystem\Test\Unit; use Engelsystem\Application; -use PHPUnit\Framework\MockObject\Matcher\InvokedRecorder; -use PHPUnit\Framework\TestCase; use PHPUnit_Framework_MockObject_MockObject as MockObject; abstract class ServiceProviderTest extends TestCase @@ -20,31 +18,4 @@ abstract class ServiceProviderTest extends TestCase ->setMethods($methods) ->getMock(); } - - /** - * @param MockObject $object - * @param string $method - * @param array $arguments - * @param mixed $return - * @param InvokedRecorder $times - */ - protected function setExpects($object, $method, $arguments = null, $return = null, $times = null) - { - if (is_null($times)) { - $times = $this->once(); - } - - $invocation = $object->expects($times) - ->method($method); - - if (is_null($arguments)) { - $invocation->withAnyParameters(); - } else { - call_user_func_array([$invocation, 'with'], $arguments); - } - - if (!is_null($return)) { - $invocation->willReturn($return); - } - } } -- cgit v1.2.3-54-g00ecf