From 06763a6ea7d23def79e606782d0918a5cbc1dc72 Mon Sep 17 00:00:00 2001 From: "t.mueller" Date: Mon, 14 Jan 2019 15:05:36 +0100 Subject: [PATCH] fix Unittests --- composer.json | 2 +- src/EasyMock.php | 2 +- tests/EasyMockTest.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index dad680a..0a41051 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "require": { "php": "~7.0", - "phpunit/phpunit-mock-objects": "~4.0|~5.0|~6.0" + "phpunit/phpunit-mock-objects": "~5.0|~6.0" }, "require-dev": { "phpunit/phpunit": "~6.4|~7.0" diff --git a/src/EasyMock.php b/src/EasyMock.php index 8c08c7e..ee07c4f 100644 --- a/src/EasyMock.php +++ b/src/EasyMock.php @@ -34,7 +34,7 @@ protected function easyMock($classname, array $methods = array()) } foreach ($methods as $method => $return) { - $this->mockMethod($mock, $method, new AnyInvokedCount, $return); + $this->mockMethod($mock, $method, new AnyInvokedCount(), $return); } return $mock; diff --git a/tests/EasyMockTest.php b/tests/EasyMockTest.php index 1771b92..2e37ff3 100644 --- a/tests/EasyMockTest.php +++ b/tests/EasyMockTest.php @@ -35,7 +35,7 @@ public function should_mock_objects() public function should_skip_the_constructor() { /** @var ClassWithConstructor $mock */ - $mock = $this->easyMock('EasyMock\Test\Fixture\ClassWithConstructor'); + $mock = $this->easyMock('\EasyMock\Test\Fixture\ClassWithConstructor'); $this->assertFalse($mock->constructorCalled); } @@ -128,7 +128,7 @@ public function should_allow_to_spy_method_calls() )); // Test PHPUnit's internals to check that the spy was registered - $property = new \ReflectionProperty('PHPUnit\Framework\TestCase', 'mockObjects'); + $property = new \ReflectionProperty('\PHPUnit\Framework\TestCase', 'mockObjects'); $property->setAccessible(true); $mockObjects = $property->getValue($this);