diff --git a/CHANGELOG.md b/CHANGELOG.md index bbe7b7ea9..547691d89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 4.0.0 - TBD + +### Added + +- Nothing. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 3.2.0 - 2020-12-14 ### Added @@ -114,7 +136,7 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- [zendframework/zend-mvc#210](https://github.com/zendframework/zend-mvc/pull/210) copies the +- [zendframework/zend-mvc#210](https://github.com/zendframework/zend-mvc/pull/210) copies the `RouteMatch` and its parameters to the PSR-7 `ServerRequest` object so that they are available to middleware. @@ -568,7 +590,7 @@ for full details on how to migrate your v2 application. emitted by `ServiceLocatorAware` initializers; in particular, all `AbstractController` implementations were raising a deprecation wen first pulled from the `ControllerManager`. - + At this time, notices are now only raised in the following conditions: - When a non-controller, non-plugin manager, `ServiceLocatorAware` instance @@ -735,7 +757,7 @@ for full details on how to migrate your v2 application. `HydratorPluginManager` will be pulled from laminas-hydrator, by updating your typehints to use the laminas-hydrator classes instead of those from laminas-stdlib; the instances returned from the laminas-stdlib `HydratorPluginManager`, because - they extend those from laminas-hydrator, remain compatible. + they extend those from laminas-hydrator, remain compatible. ## 2.6.0 - 2015-09-22 diff --git a/composer.json b/composer.json index 483148db1..c2cf3103a 100644 --- a/composer.json +++ b/composer.json @@ -22,21 +22,20 @@ }, "require": { "php": "^7.3 || ~8.0.0", - "container-interop/container-interop": "^1.2", "laminas/laminas-eventmanager": "^3.2", - "laminas/laminas-http": "^2.7", - "laminas/laminas-modulemanager": "^2.8", - "laminas/laminas-router": "^3.0.2", - "laminas/laminas-servicemanager": "^3.3", + "laminas/laminas-http": "^2.11.2", + "laminas/laminas-modulemanager": "^2.8.2", + "laminas/laminas-router": "^3.3.2", + "laminas/laminas-servicemanager": "^3.4.1", "laminas/laminas-stdlib": "^3.2.1", - "laminas/laminas-view": "^2.11.3", - "laminas/laminas-zendframework-bridge": "^1.0" + "laminas/laminas-view": "^2.11.4", + "psr/container": "^1.0" }, "require-dev": { "http-interop/http-middleware": "^0.4.1", "laminas/laminas-coding-standard": "^1.0.0", "laminas/laminas-json": "^2.6.1 || ^3.0", - "laminas/laminas-psr7bridge": "^1.0", + "laminas/laminas-psr7bridge": "^1.2.2", "laminas/laminas-stratigility": ">=2.0.1 <2.2", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.4.2" @@ -76,8 +75,5 @@ "cs-fix": "phpcbf", "test": "phpunit --colors=always", "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" - }, - "replace": { - "zendframework/zend-mvc": "^3.1.1" } } diff --git a/src/Controller/AbstractRestfulController.php b/src/Controller/AbstractRestfulController.php index 3e83e73ba..b0ceb07a7 100644 --- a/src/Controller/AbstractRestfulController.php +++ b/src/Controller/AbstractRestfulController.php @@ -425,7 +425,8 @@ public function onDispatch(MvcEvent $e) // POST case 'post': $action = 'create'; - $return = $this->processPostData($request); + $data = $this->processPostData($request); + $return = $this->create($data); break; // PUT case 'put': @@ -454,7 +455,7 @@ public function onDispatch(MvcEvent $e) } /** - * Process post data and call create + * Process post data * * @param Request $request * @return mixed @@ -464,10 +465,10 @@ public function onDispatch(MvcEvent $e) public function processPostData(Request $request) { if ($this->requestHasContentType($request, self::CONTENT_TYPE_JSON)) { - return $this->create($this->jsonDecode($request->getContent())); + return $this->jsonDecode($request->getContent()); } - return $this->create($request->getPost()->toArray()); + return $request->getPost()->toArray(); } /** diff --git a/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php b/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php index b13594582..3e99cc6be 100644 --- a/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php +++ b/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php @@ -12,7 +12,7 @@ use Laminas\Mvc\MvcEvent; use PHPUnit\Framework\TestCase; -class InvalidControllerTypeShouldTrigerDispatchErrorTest extends TestCase +class InvalidControllerTypeShouldTriggerDispatchErrorTest extends TestCase { use InvalidControllerTypeTrait; diff --git a/test/ApplicationTest.php b/test/ApplicationTest.php index 7dbd6925c..5fd5f96e3 100644 --- a/test/ApplicationTest.php +++ b/test/ApplicationTest.php @@ -44,7 +44,7 @@ class ApplicationTest extends TestCase */ protected $application; - public function setUp(): void + protected function setUp() : void { $serviceListener = new ServiceListenerFactory(); $r = new ReflectionProperty($serviceListener, 'defaultServiceConfig'); diff --git a/test/Controller/AbstractControllerTest.php b/test/Controller/AbstractControllerTest.php index 298ce7064..8d34b8d4c 100644 --- a/test/Controller/AbstractControllerTest.php +++ b/test/Controller/AbstractControllerTest.php @@ -14,6 +14,7 @@ use Laminas\Mvc\InjectApplicationEventInterface; use Laminas\Stdlib\DispatchableInterface; use LaminasTest\Mvc\Controller\TestAsset\AbstractControllerStub; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use ReflectionProperty; @@ -37,24 +38,26 @@ protected function setUp(): void public function testSetEventManagerWithDefaultIdentifiers() { - /* @var $eventManager EventManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ + /* @var $eventManager EventManagerInterface&MockObject */ $eventManager = $this->createMock(EventManagerInterface::class); $eventManager ->expects($this->once()) ->method('setIdentifiers') - ->with($this->logicalNot($this->containsEqual('customEventIdentifier'))); + ->with($this->logicalNot($this->containsIdentical('customEventIdentifier'))); $this->controller->setEventManager($eventManager); } public function testSetEventManagerWithCustomStringIdentifier() { - /* @var $eventManager EventManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ + /* @var $eventManager EventManagerInterface&MockObject */ $eventManager = $this->createMock(EventManagerInterface::class); - $eventManager->expects($this->once())->method('setIdentifiers') - ->with($this->containsEqual('customEventIdentifier')); + $eventManager + ->expects($this->once()) + ->method('setIdentifiers') + ->with($this->containsIdentical('customEventIdentifier')); $reflection = new ReflectionProperty($this->controller, 'eventIdentifier'); @@ -66,12 +69,12 @@ public function testSetEventManagerWithCustomStringIdentifier() public function testSetEventManagerWithMultipleCustomStringIdentifier() { - /* @var $eventManager EventManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ + /* @var $eventManager EventManagerInterface&MockObject */ $eventManager = $this->createMock(EventManagerInterface::class); $eventManager->expects($this->once())->method('setIdentifiers')->with($this->logicalAnd( - $this->containsEqual('customEventIdentifier1'), - $this->containsEqual('customEventIdentifier2') + $this->containsIdentical('customEventIdentifier1'), + $this->containsIdentical('customEventIdentifier2') )); $reflection = new ReflectionProperty($this->controller, 'eventIdentifier'); @@ -84,16 +87,16 @@ public function testSetEventManagerWithMultipleCustomStringIdentifier() public function testSetEventManagerWithDefaultIdentifiersIncludesImplementedInterfaces() { - /* @var $eventManager EventManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ + /* @var $eventManager EventManagerInterface&MockObject */ $eventManager = $this->createMock(EventManagerInterface::class); $eventManager ->expects($this->once()) ->method('setIdentifiers') ->with($this->logicalAnd( - $this->containsEqual(EventManagerAwareInterface::class), - $this->containsEqual(DispatchableInterface::class), - $this->containsEqual(InjectApplicationEventInterface::class) + $this->containsIdentical(EventManagerAwareInterface::class), + $this->containsIdentical(DispatchableInterface::class), + $this->containsIdentical(InjectApplicationEventInterface::class) )); $this->controller->setEventManager($eventManager); @@ -101,17 +104,17 @@ public function testSetEventManagerWithDefaultIdentifiersIncludesImplementedInte public function testSetEventManagerWithDefaultIdentifiersIncludesExtendingClassNameAndNamespace() { - /* @var $eventManager EventManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ + /* @var $eventManager EventManagerInterface&MockObject */ $eventManager = $this->createMock(EventManagerInterface::class); $eventManager ->expects($this->once()) ->method('setIdentifiers') ->with($this->logicalAnd( - $this->containsEqual(AbstractController::class), - $this->containsEqual(AbstractControllerStub::class), - $this->containsEqual('LaminasTest'), - $this->containsEqual('LaminasTest\\Mvc\\Controller\\TestAsset') + $this->containsIdentical(AbstractController::class), + $this->containsIdentical(AbstractControllerStub::class), + $this->containsIdentical('LaminasTest'), + $this->containsIdentical('LaminasTest\\Mvc\\Controller\\TestAsset') )); $this->controller->setEventManager($eventManager); diff --git a/test/Controller/ActionControllerTest.php b/test/Controller/ActionControllerTest.php index 8b4934984..e7ec1c9f2 100644 --- a/test/Controller/ActionControllerTest.php +++ b/test/Controller/ActionControllerTest.php @@ -32,8 +32,9 @@ class ActionControllerTest extends TestCase public $event; public $request; public $response; + private $routeMatch; - public function setUp(): void + protected function setUp() : void { $this->controller = new SampleController(); $this->request = new Request(); diff --git a/test/Controller/ControllerManagerTest.php b/test/Controller/ControllerManagerTest.php index 71ae4fabb..f4edd4922 100644 --- a/test/Controller/ControllerManagerTest.php +++ b/test/Controller/ControllerManagerTest.php @@ -22,7 +22,7 @@ class ControllerManagerTest extends TestCase { - public function setUp(): void + protected function setUp() : void { $this->sharedEvents = new SharedEventManager; $this->events = $this->createEventManager($this->sharedEvents); @@ -88,8 +88,8 @@ public function testInjectEventManagerWillNotOverwriteExistingEventManagerIfItAl } /** - * @covers Laminas\ServiceManager\ServiceManager::has - * @covers Laminas\ServiceManager\AbstractPluginManager::get + * @covers \Laminas\ServiceManager\ServiceManager::has + * @covers \Laminas\ServiceManager\AbstractPluginManager::get */ public function testDoNotUsePeeringServiceManagers() { diff --git a/test/Controller/IntegrationTest.php b/test/Controller/IntegrationTest.php index e24bc9520..adf5d0700 100644 --- a/test/Controller/IntegrationTest.php +++ b/test/Controller/IntegrationTest.php @@ -18,7 +18,7 @@ class IntegrationTest extends TestCase { - public function setUp(): void + protected function setUp() : void { $this->sharedEvents = new SharedEventManager(); diff --git a/test/Controller/LazyControllerAbstractFactoryTest.php b/test/Controller/LazyControllerAbstractFactoryTest.php index 2a5bf41fd..4ce68c30a 100644 --- a/test/Controller/LazyControllerAbstractFactoryTest.php +++ b/test/Controller/LazyControllerAbstractFactoryTest.php @@ -24,7 +24,7 @@ class LazyControllerAbstractFactoryTest extends TestCase */ private $container; - public function setUp(): void + protected function setUp(): void { $this->container = $this->prophesize(ContainerInterface::class); } diff --git a/test/Controller/MiddlewareControllerTest.php b/test/Controller/MiddlewareControllerTest.php index ad5a1ead9..3c76cb53b 100644 --- a/test/Controller/MiddlewareControllerTest.php +++ b/test/Controller/MiddlewareControllerTest.php @@ -19,6 +19,7 @@ use Laminas\Stdlib\DispatchableInterface; use Laminas\Stdlib\RequestInterface; use Laminas\Stratigility\MiddlewarePipe; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Http\Message\ResponseInterface; @@ -31,12 +32,12 @@ class MiddlewareControllerTest extends TestCase { /** - * @var MiddlewarePipe|\PHPUnit_Framework_MockObject_MockObject + * @var MiddlewarePipe&MockObject */ private $pipe; /** - * @var ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ResponseInterface&MockObject */ private $responsePrototype; @@ -46,7 +47,7 @@ class MiddlewareControllerTest extends TestCase private $eventManager; /** - * @var AbstractController|\PHPUnit_Framework_MockObject_MockObject + * @var AbstractController&MockObject */ private $controller; @@ -58,7 +59,7 @@ class MiddlewareControllerTest extends TestCase /** * {@inheritDoc} */ - protected function setUp(): void + protected function setUp() : void { $this->pipe = $this->createMock(MiddlewarePipe::class); $this->responsePrototype = $this->createMock(ResponseInterface::class); @@ -88,7 +89,7 @@ public function testWillDispatchARequestAndResponseWithAGivenPipe() $request = new Request(); $response = new Response(); $result = $this->createMock(ResponseInterface::class); - /* @var $dispatchListener callable|\PHPUnit_Framework_MockObject_MockObject */ + /* @var $dispatchListener callable&MockObject */ $dispatchListener = $this->getMockBuilder(\stdClass::class)->setMethods(['__invoke'])->getMock(); $this->eventManager->attach(MvcEvent::EVENT_DISPATCH, $dispatchListener, 100); @@ -122,7 +123,7 @@ public function testWillRefuseDispatchingInvalidRequestTypes() /* @var $request RequestInterface */ $request = $this->createMock(RequestInterface::class); $response = new Response(); - /* @var $dispatchListener callable|\PHPUnit_Framework_MockObject_MockObject */ + /* @var $dispatchListener callable&MockObject */ $dispatchListener = $this->getMockBuilder(\stdClass::class)->setMethods(['__invoke'])->getMock(); $this->eventManager->attach(MvcEvent::EVENT_DISPATCH, $dispatchListener, 100); diff --git a/test/Controller/Plugin/AcceptableViewModelSelectorTest.php b/test/Controller/Plugin/AcceptableViewModelSelectorTest.php index 72170cc88..dd4f45147 100644 --- a/test/Controller/Plugin/AcceptableViewModelSelectorTest.php +++ b/test/Controller/Plugin/AcceptableViewModelSelectorTest.php @@ -19,7 +19,7 @@ class AcceptableViewModelSelectorTest extends TestCase { - public function setUp(): void + protected function setUp() : void { $this->request = new Request(); diff --git a/test/Controller/Plugin/ForwardTest.php b/test/Controller/Plugin/ForwardTest.php index cbc572422..85d9c250f 100644 --- a/test/Controller/Plugin/ForwardTest.php +++ b/test/Controller/Plugin/ForwardTest.php @@ -54,7 +54,7 @@ class ForwardTest extends TestCase */ private $plugin; - public function setUp(): void + protected function setUp() : void { $eventManager = $this->createEventManager(new SharedEventManager()); $mockApplication = $this->createMock(ApplicationInterface::class); diff --git a/test/Controller/Plugin/LayoutTest.php b/test/Controller/Plugin/LayoutTest.php index f9d83e385..a4215886b 100644 --- a/test/Controller/Plugin/LayoutTest.php +++ b/test/Controller/Plugin/LayoutTest.php @@ -17,7 +17,7 @@ class LayoutTest extends TestCase { - public function setUp(): void + protected function setUp() : void { $this->event = $event = new MvcEvent(); $this->controller = new SampleController(); diff --git a/test/Controller/Plugin/ParamsTest.php b/test/Controller/Plugin/ParamsTest.php index d9e47b42b..901545e9f 100644 --- a/test/Controller/Plugin/ParamsTest.php +++ b/test/Controller/Plugin/ParamsTest.php @@ -18,7 +18,7 @@ class ParamsTest extends TestCase { - public function setUp(): void + protected function setUp() : void { $this->request = new Request; $event = new MvcEvent; diff --git a/test/Controller/Plugin/RedirectTest.php b/test/Controller/Plugin/RedirectTest.php index 77bacbd80..6b7902b14 100644 --- a/test/Controller/Plugin/RedirectTest.php +++ b/test/Controller/Plugin/RedirectTest.php @@ -22,7 +22,7 @@ class RedirectTest extends TestCase { - public function setUp(): void + protected function setUp() : void { $this->response = new Response(); diff --git a/test/Controller/Plugin/UrlTest.php b/test/Controller/Plugin/UrlTest.php index a53d13cac..4248c8a55 100644 --- a/test/Controller/Plugin/UrlTest.php +++ b/test/Controller/Plugin/UrlTest.php @@ -25,7 +25,7 @@ class UrlTest extends TestCase { - public function setUp(): void + protected function setUp() : void { $router = new SimpleRouteStack; $router->addRoute('home', LiteralRoute::factory([ diff --git a/test/Controller/RestfulControllerTest.php b/test/Controller/RestfulControllerTest.php index 2a0ce7d0f..eca1d54cd 100644 --- a/test/Controller/RestfulControllerTest.php +++ b/test/Controller/RestfulControllerTest.php @@ -23,11 +23,16 @@ use LaminasTest\Mvc\Controller\TestAsset\RestfulMethodNotAllowedTestController; use LaminasTest\Mvc\Controller\TestAsset\RestfulTestController; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; use ReflectionObject; use stdClass; +use function json_encode; + class RestfulControllerTest extends TestCase { + use ProphecyTrait; + public $controller; public $emptyController; public $request; @@ -35,7 +40,7 @@ class RestfulControllerTest extends TestCase public $routeMatch; public $event; - public function setUp(): void + protected function setUp() : void { $this->controller = new RestfulTestController(); $this->emptyController = new RestfulMethodNotAllowedTestController(); diff --git a/test/HttpMethodListenerTest.php b/test/HttpMethodListenerTest.php index 54579b667..a98be992f 100644 --- a/test/HttpMethodListenerTest.php +++ b/test/HttpMethodListenerTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; /** - * @covers Laminas\Mvc\HttpMethodListener + * @covers \Laminas\Mvc\HttpMethodListener */ class HttpMethodListenerTest extends TestCase { @@ -27,7 +27,7 @@ class HttpMethodListenerTest extends TestCase */ protected $listener; - public function setUp(): void + protected function setUp() : void { $this->listener = new HttpMethodListener(); } diff --git a/test/ModuleRouteListenerTest.php b/test/ModuleRouteListenerTest.php index 8b7c5c800..07934abdf 100644 --- a/test/ModuleRouteListenerTest.php +++ b/test/ModuleRouteListenerTest.php @@ -19,7 +19,7 @@ class ModuleRouteListenerTest extends TestCase { - public function setUp(): void + protected function setUp() : void { $this->request = new Request(); $this->events = new EventManager(); diff --git a/test/Service/ControllerManagerFactoryTest.php b/test/Service/ControllerManagerFactoryTest.php index afe319c7b..09c0619ff 100644 --- a/test/Service/ControllerManagerFactoryTest.php +++ b/test/Service/ControllerManagerFactoryTest.php @@ -33,7 +33,7 @@ class ControllerManagerFactoryTest extends TestCase */ protected $loader; - public function setUp(): void + protected function setUp() : void { $loaderFactory = new ControllerManagerFactory(); $this->defaultServiceConfig = [ diff --git a/test/Service/HttpMethodListenerFactoryTest.php b/test/Service/HttpMethodListenerFactoryTest.php index b916eab52..d1656924d 100644 --- a/test/Service/HttpMethodListenerFactoryTest.php +++ b/test/Service/HttpMethodListenerFactoryTest.php @@ -11,23 +11,23 @@ use Interop\Container\ContainerInterface; use Laminas\Mvc\Service\HttpMethodListenerFactory; use Laminas\ServiceManager\ServiceLocatorInterface; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use PHPUnit_Framework_MockObject_MockObject as MockObject; use Prophecy\PhpUnit\ProphecyTrait; /** - * @covers Laminas\Mvc\Service\HttpMethodListenerFactory + * @covers \Laminas\Mvc\Service\HttpMethodListenerFactory */ class HttpMethodListenerFactoryTest extends TestCase { use ProphecyTrait; /** - * @var ServiceLocatorInterface|MockObject + * @var ServiceLocatorInterface&MockObject */ protected $serviceLocator; - public function setUp(): void + protected function setUp() : void { $this->serviceLocator = $this->prophesize(ServiceLocatorInterface::class); $this->serviceLocator->willImplement(ContainerInterface::class); diff --git a/test/Service/ServiceListenerFactoryTest.php b/test/Service/ServiceListenerFactoryTest.php index 71c9a9d68..59fdf2abc 100644 --- a/test/Service/ServiceListenerFactoryTest.php +++ b/test/Service/ServiceListenerFactoryTest.php @@ -15,7 +15,7 @@ class ServiceListenerFactoryTest extends TestCase { - public function setUp(): void + protected function setUp() : void { $this->sm = $this->getMockBuilder(ServiceManager::class) ->setMethods(['get']) @@ -31,8 +31,7 @@ public function testInvalidOptionType() ->will($this->returnValue(['service_listener_options' => 'string'])); $this->expectException(ServiceNotCreatedException::class); - $this->expectExceptionMessage("The value of service_listener_options must be an array, string given."); - + $this->expectExceptionMessage('The value of service_listener_options must be an array, string given.'); $this->factory->__invoke($this->sm, 'ServiceListener'); } @@ -49,9 +48,8 @@ public function testMissingServiceManager() $this->expectException(ServiceNotCreatedException::class); $this->expectExceptionMessage( - 'Invalid service listener options detected, 0 array must contain service_manager key.', + 'Invalid service listener options detected, 0 array must contain service_manager key.' ); - $this->factory->__invoke($this->sm, 'ServiceListener'); } @@ -66,11 +64,12 @@ public function testInvalidTypeServiceManager() ->method('get') ->will($this->returnValue($config)); + $this->expectException( + ServiceNotCreatedException::class + ); $this->expectExceptionMessage( - 'Invalid service listener options detected, service_manager must be a string, integer given.', + 'Invalid service listener options detected, service_manager must be a string, integer given.' ); - $this->expectException(ServiceNotCreatedException::class); - $this->factory->__invoke($this->sm, 'ServiceListener'); } @@ -87,9 +86,8 @@ public function testMissingConfigKey() $this->expectException(ServiceNotCreatedException::class); $this->expectExceptionMessage( - 'Invalid service listener options detected, 0 array must contain config_key key.', + 'Invalid service listener options detected, 0 array must contain config_key key.' ); - $this->factory->__invoke($this->sm, 'ServiceListener'); } @@ -106,9 +104,8 @@ public function testInvalidTypeConfigKey() $this->expectException(ServiceNotCreatedException::class); $this->expectExceptionMessage( - 'Invalid service listener options detected, config_key must be a string, integer given.', + 'Invalid service listener options detected, config_key must be a string, integer given.' ); - $this->factory->__invoke($this->sm, 'ServiceListener'); } @@ -123,9 +120,8 @@ public function testMissingInterface() ->method('get') ->will($this->returnValue($config)); - $this->expectExceptionMessage("Invalid service listener options detected, 0 array must contain interface key."); $this->expectException(ServiceNotCreatedException::class); - + $this->expectExceptionMessage('Invalid service listener options detected, 0 array must contain interface key.'); $this->factory->__invoke($this->sm, 'ServiceListener'); } @@ -140,11 +136,10 @@ public function testInvalidTypeInterface() ->method('get') ->will($this->returnValue($config)); + $this->expectException(ServiceNotCreatedException::class); $this->expectExceptionMessage( - 'Invalid service listener options detected, interface must be a string, integer given.', + 'Invalid service listener options detected, interface must be a string, integer given.' ); - $this->expectException(ServiceNotCreatedException::class); - $this->factory->__invoke($this->sm, 'ServiceListener'); } @@ -160,8 +155,7 @@ public function testMissingMethod() ->will($this->returnValue($config)); $this->expectException(ServiceNotCreatedException::class); - $this->expectExceptionMessage("Invalid service listener options detected, 0 array must contain method key."); - + $this->expectExceptionMessage('Invalid service listener options detected, 0 array must contain method key.'); $this->factory->__invoke($this->sm, 'ServiceListener'); } @@ -176,11 +170,10 @@ public function testInvalidTypeMethod() ->method('get') ->will($this->returnValue($config)); + $this->expectException(ServiceNotCreatedException::class); $this->expectExceptionMessage( - 'Invalid service listener options detected, method must be a string, integer given.', + 'Invalid service listener options detected, method must be a string, integer given.' ); - $this->expectException(ServiceNotCreatedException::class); - $this->factory->__invoke($this->sm, 'ServiceListener'); } } diff --git a/test/Service/ServiceManagerConfigTest.php b/test/Service/ServiceManagerConfigTest.php index 35a59209d..38fa84d4a 100644 --- a/test/Service/ServiceManagerConfigTest.php +++ b/test/Service/ServiceManagerConfigTest.php @@ -36,7 +36,7 @@ class ServiceManagerConfigTest extends TestCase /** * {@inheritDoc} */ - protected function setUp(): void + protected function setUp() : void { $this->config = new ServiceManagerConfig(); $this->services = new ServiceManager(); diff --git a/test/Service/ViewHelperManagerFactoryTest.php b/test/Service/ViewHelperManagerFactoryTest.php index 381cf4436..4064d3d1d 100644 --- a/test/Service/ViewHelperManagerFactoryTest.php +++ b/test/Service/ViewHelperManagerFactoryTest.php @@ -21,7 +21,7 @@ class ViewHelperManagerFactoryTest extends TestCase { - public function setUp(): void + protected function setUp() : void { $this->services = new ServiceManager(); $this->factory = new ViewHelperManagerFactory(); diff --git a/test/View/CreateViewModelListenerTest.php b/test/View/CreateViewModelListenerTest.php index 14fca956f..fb4eacce8 100644 --- a/test/View/CreateViewModelListenerTest.php +++ b/test/View/CreateViewModelListenerTest.php @@ -20,7 +20,7 @@ class CreateViewModelListenerTest extends TestCase { use EventListenerIntrospectionTrait; - public function setUp(): void + protected function setUp() : void { $this->listener = new CreateViewModelListener(); $this->event = new MvcEvent(); diff --git a/test/View/DefaultRendereringStrategyTest.php b/test/View/DefaultRendereringStrategyTest.php index 2caeb8618..e4b2c4a06 100644 --- a/test/View/DefaultRendereringStrategyTest.php +++ b/test/View/DefaultRendereringStrategyTest.php @@ -36,7 +36,7 @@ class DefaultRendereringStrategyTest extends TestCase protected $renderer; protected $strategy; - public function setUp(): void + protected function setUp() : void { $this->view = new View(); $this->request = new Request(); diff --git a/test/View/ExceptionStrategyTest.php b/test/View/ExceptionStrategyTest.php index 588e632fa..187dd4216 100644 --- a/test/View/ExceptionStrategyTest.php +++ b/test/View/ExceptionStrategyTest.php @@ -21,7 +21,7 @@ class ExceptionStrategyTest extends TestCase { use EventListenerIntrospectionTrait; - public function setUp(): void + protected function setUp() : void { $this->strategy = new ExceptionStrategy(); } diff --git a/test/View/InjectTemplateListenerTest.php b/test/View/InjectTemplateListenerTest.php index 76d18b73b..01865b45f 100644 --- a/test/View/InjectTemplateListenerTest.php +++ b/test/View/InjectTemplateListenerTest.php @@ -22,7 +22,7 @@ class InjectTemplateListenerTest extends TestCase { use EventListenerIntrospectionTrait; - public function setUp(): void + protected function setUp() : void { $controllerMap = [ 'MappedNs' => true, diff --git a/test/View/InjectViewModelListenerTest.php b/test/View/InjectViewModelListenerTest.php index 5ccfa97a0..fe7bac087 100644 --- a/test/View/InjectViewModelListenerTest.php +++ b/test/View/InjectViewModelListenerTest.php @@ -20,7 +20,7 @@ class InjectViewModelListenerTest extends TestCase { use EventListenerIntrospectionTrait; - public function setUp(): void + protected function setUp() : void { $this->listener = new InjectViewModelListener(); $this->event = new MvcEvent(); diff --git a/test/View/RouteNotFoundStrategyTest.php b/test/View/RouteNotFoundStrategyTest.php index 885ca2fdb..8c5137b56 100644 --- a/test/View/RouteNotFoundStrategyTest.php +++ b/test/View/RouteNotFoundStrategyTest.php @@ -27,7 +27,7 @@ class RouteNotFoundStrategyTest extends TestCase */ private $strategy; - public function setUp(): void + protected function setUp() : void { $this->strategy = new RouteNotFoundStrategy(); }