From c4913a1dad79409fa0ef2e942bcef11f09e0c044 Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 12:26:04 +0100 Subject: [PATCH 01/13] Add php 8.4 support Signed-off-by: fezfez --- .laminas-ci.json | 2 +- composer.json | 4 +- composer.lock | 300 ++--------------------------------------------- 3 files changed, 9 insertions(+), 297 deletions(-) diff --git a/.laminas-ci.json b/.laminas-ci.json index 623a8eca..cc00d67d 100644 --- a/.laminas-ci.json +++ b/.laminas-ci.json @@ -1,5 +1,5 @@ { "ignore_php_platform_requirements": { - "8.3": true + "8.4": true } } diff --git a/composer.json b/composer.json index 7fe13660..57c194e7 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "extra": { }, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "container-interop/container-interop": "^1.2", "laminas/laminas-eventmanager": "^3.4", "laminas/laminas-http": "^2.15", @@ -41,8 +41,6 @@ "require-dev": { "laminas/laminas-coding-standard": "^2.5.0", "laminas/laminas-json": "^3.6", - "phpspec/prophecy": "^1.17.0", - "phpspec/prophecy-phpunit": "^2.0.2", "phpunit/phpunit": "^9.6.13", "webmozart/assert": "^1.11" }, diff --git a/composer.lock b/composer.lock index 196a68dd..432e830f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "92a38fc09e283dd8889ace14971a0eba", + "content-hash": "264aa3f1e4135ef7d787b4f56e01cec2", "packages": [ { "name": "brick/varexporter", @@ -1568,292 +1568,6 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.2", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", - "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", - "shasum": "" - }, - "require": { - "php": "^7.4 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" - }, - "time": "2022-10-14T12:47:21+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.19.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/67a759e7d8746d501c41536ba40cd9c0a07d6a87", - "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2 || ^2.0", - "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.*", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0", - "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "dev", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.19.0" - }, - "time": "2024-02-29T11:52:51+00:00" - }, - { - "name": "phpspec/prophecy-phpunit", - "version": "v2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy-phpunit.git", - "reference": "16e1247e139434bce0bac09848bc5c8d882940fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/16e1247e139434bce0bac09848bc5c8d882940fc", - "reference": "16e1247e139434bce0bac09848bc5c8d882940fc", - "shasum": "" - }, - "require": { - "php": "^7.3 || ^8", - "phpspec/prophecy": "^1.18", - "phpunit/phpunit": "^9.1 || ^10.1 || ^11.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\PhpUnit\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christophe Coevoet", - "email": "stof@notk.org" - } - ], - "description": "Integrating the Prophecy mocking library in PHPUnit test cases", - "homepage": "http://phpspec.net", - "keywords": [ - "phpunit", - "prophecy" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy-phpunit/issues", - "source": "https://github.com/phpspec/prophecy-phpunit/tree/v2.2.0" - }, - "time": "2024-03-01T08:33:58+00:00" - }, { "name": "phpstan/phpdoc-parser", "version": "1.5.1", @@ -3346,16 +3060,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.3", + "version": "3.11.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c" + "reference": "70c08f8d20c0eb4fe56f26644dd94dae76a7f450" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/70c08f8d20c0eb4fe56f26644dd94dae76a7f450", + "reference": "70c08f8d20c0eb4fe56f26644dd94dae76a7f450", "shasum": "" }, "require": { @@ -3422,7 +3136,7 @@ "type": "open_collective" } ], - "time": "2024-09-18T10:38:58+00:00" + "time": "2024-11-12T09:53:29+00:00" }, { "name": "theseer/tokenizer", @@ -3594,7 +3308,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "platform-dev": {}, "platform-overrides": { From f3912e594cb7d9be49e1c29db8f954358d66bb2d Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 12:26:25 +0100 Subject: [PATCH 02/13] Remove Prophecy from unit tests Signed-off-by: fezfez --- .../LazyControllerAbstractFactoryTest.php | 80 +++++++++---------- test/DispatchListenerTest.php | 18 ++--- .../Service/HttpMethodListenerFactoryTest.php | 29 +++---- .../InjectTemplateListenerFactoryTest.php | 12 +-- test/Service/RequestFactoryTest.php | 5 +- test/Service/ResponseFactoryTest.php | 5 +- .../SendResponseListenerFactoryTest.php | 55 +++++++------ test/Service/ViewFeedStrategyFactoryTest.php | 10 +-- test/Service/ViewHelperManagerFactoryTest.php | 20 ++--- test/Service/ViewJsonStrategyFactoryTest.php | 10 +-- test/Service/ViewManagerFactoryTest.php | 11 +-- ...ViewPrefixPathStackResolverFactoryTest.php | 10 +-- 12 files changed, 121 insertions(+), 144 deletions(-) diff --git a/test/Controller/LazyControllerAbstractFactoryTest.php b/test/Controller/LazyControllerAbstractFactoryTest.php index 94aac3ec..e3bb20fd 100644 --- a/test/Controller/LazyControllerAbstractFactoryTest.php +++ b/test/Controller/LazyControllerAbstractFactoryTest.php @@ -22,13 +22,11 @@ class LazyControllerAbstractFactoryTest extends TestCase { - use ProphecyTrait; - - private ContainerInterface|ObjectProphecy $container; + private ContainerInterface $container; public function setUp(): void { - $this->container = $this->prophesize(ContainerInterface::class); + $this->container = $this->createMock(ContainerInterface::class); } public function nonClassRequestedNames() @@ -44,33 +42,35 @@ public function nonClassRequestedNames() public function testCanCreateReturnsFalseForNonClassRequestedNames($requestedName) { $factory = new LazyControllerAbstractFactory(); - $this->assertFalse($factory->canCreate($this->container->reveal(), $requestedName)); + $this->assertFalse($factory->canCreate($this->container, $requestedName)); } public function testCanCreateReturnsFalseForClassesThatDoNotImplementDispatchableInterface() { $factory = new LazyControllerAbstractFactory(); - $this->assertFalse($factory->canCreate($this->container->reveal(), self::class)); + $this->assertFalse($factory->canCreate($this->container, self::class)); } public function testFactoryInstantiatesClassDirectlyIfItHasNoConstructor() { $factory = new LazyControllerAbstractFactory(); - $controller = $factory($this->container->reveal(), SampleController::class); + $controller = $factory($this->container, SampleController::class); $this->assertInstanceOf(SampleController::class, $controller); } public function testFactoryInstantiatesClassDirectlyIfConstructorHasNoArguments() { $factory = new LazyControllerAbstractFactory(); - $controller = $factory($this->container->reveal(), ControllerWithEmptyConstructor::class); + $controller = $factory($this->container, ControllerWithEmptyConstructor::class); $this->assertInstanceOf(ControllerWithEmptyConstructor::class, $controller); } public function testFactoryRaisesExceptionWhenUnableToResolveATypeHintedService() { - $this->container->has(SampleInterface::class)->willReturn(false); - $this->container->has(\ZendTest\Mvc\Controller\TestAsset\SampleInterface::class)->willReturn(false); + $this->container->method('has')->willReturnMap([ + [SampleInterface::class, false], + [\ZendTest\Mvc\Controller\TestAsset\SampleInterface::class, false] + ]); $factory = new LazyControllerAbstractFactory(); $this->expectException(ServiceNotFoundException::class); $this->expectExceptionMessage( @@ -80,7 +80,7 @@ public function testFactoryRaisesExceptionWhenUnableToResolveATypeHintedService( SampleInterface::class ) ); - $factory($this->container->reveal(), ControllerWithTypeHintedConstructorParameter::class); + $factory($this->container, ControllerWithTypeHintedConstructorParameter::class); } /** @@ -88,7 +88,7 @@ public function testFactoryRaisesExceptionWhenUnableToResolveATypeHintedService( */ public function testFactoryRaisesExceptionWhenResolvingUnionTypeHintedService(): void { - $this->container->has(SampleInterface::class)->willReturn(false); + $this->container->method('has')->willReturn(false); $factory = new LazyControllerAbstractFactory(); $this->expectException(DomainException::class); $this->expectExceptionMessage( @@ -97,13 +97,13 @@ public function testFactoryRaisesExceptionWhenResolvingUnionTypeHintedService(): ControllerWithUnionTypeHintedConstructorParameter::class ) ); - $factory($this->container->reveal(), ControllerWithUnionTypeHintedConstructorParameter::class); + $factory($this->container, ControllerWithUnionTypeHintedConstructorParameter::class); } public function testFactoryPassesNullForScalarParameters() { $factory = new LazyControllerAbstractFactory(); - $controller = $factory($this->container->reveal(), ControllerWithScalarParameters::class); + $controller = $factory($this->container, ControllerWithScalarParameters::class); $this->assertInstanceOf(ControllerWithScalarParameters::class, $controller); $this->assertNull($controller->foo); $this->assertNull($controller->bar); @@ -112,24 +112,24 @@ public function testFactoryPassesNullForScalarParameters() public function testFactoryInjectsConfigServiceForConfigArgumentsTypeHintedAsArray() { $config = ['foo' => 'bar']; - $this->container->has('config')->willReturn(true); - $this->container->get('config')->willReturn($config); + $this->container->method('has')->with('config')->willReturn(true); + $this->container->method('get')->with('config')->willReturn($config); $factory = new LazyControllerAbstractFactory(); - $controller = $factory($this->container->reveal(), ControllerAcceptingConfigToConstructor::class); + $controller = $factory($this->container, ControllerAcceptingConfigToConstructor::class); $this->assertInstanceOf(ControllerAcceptingConfigToConstructor::class, $controller); $this->assertEquals($config, $controller->config); } public function testFactoryCanInjectKnownTypeHintedServices() { - $sample = $this->prophesize(SampleInterface::class)->reveal(); - $this->container->has(SampleInterface::class)->willReturn(true); - $this->container->get(SampleInterface::class)->willReturn($sample); + $sample = $this->createMock(SampleInterface::class); + $this->container->method('has')->with(SampleInterface::class)->willReturn(true); + $this->container->method('get')->with(SampleInterface::class)->willReturn($sample); $factory = new LazyControllerAbstractFactory(); $controller = $factory( - $this->container->reveal(), + $this->container, ControllerWithTypeHintedConstructorParameter::class ); $this->assertInstanceOf(ControllerWithTypeHintedConstructorParameter::class, $controller); @@ -138,13 +138,13 @@ public function testFactoryCanInjectKnownTypeHintedServices() public function testFactoryResolvesTypeHintsForServicesToWellKnownServiceNames() { - $validators = $this->prophesize(ValidatorPluginManager::class)->reveal(); - $this->container->has('ValidatorManager')->willReturn(true); - $this->container->get('ValidatorManager')->willReturn($validators); + $validators = $this->createMock(ValidatorPluginManager::class); + $this->container->method('has')->with('ValidatorManager')->willReturn(true); + $this->container->method('get')->with('ValidatorManager')->willReturn($validators); $factory = new LazyControllerAbstractFactory(); $controller = $factory( - $this->container->reveal(), + $this->container, ControllerAcceptingWellKnownServicesAsConstructorParameters::class ); $this->assertInstanceOf( @@ -156,26 +156,26 @@ public function testFactoryResolvesTypeHintsForServicesToWellKnownServiceNames() public function testFactoryCanSupplyAMixOfParameterTypes() { - $validators = $this->prophesize(ValidatorPluginManager::class)->reveal(); - $this->container->has('ValidatorManager')->willReturn(true); - $this->container->get('ValidatorManager')->willReturn($validators); - - $sample = $this->prophesize(SampleInterface::class)->reveal(); - $this->container->has(SampleInterface::class)->willReturn(true); - $this->container->get(SampleInterface::class)->willReturn($sample); - - $config = ['foo' => 'bar']; - $this->container->has('config')->willReturn(true); - $this->container->get('config')->willReturn($config); + $validators = $this->createMock(ValidatorPluginManager::class); + $this->container->method('has')->willReturnMap([ + ['ValidatorManager', true], + [SampleInterface::class, true], + ['config', true] + ]); + $this->container->method('get')->willReturnMap([ + ['ValidatorManager', $validators], + [SampleInterface::class, $this->createMock(SampleInterface::class)], + ['config', ['foo' => 'bar']] + ]); $factory = new LazyControllerAbstractFactory(); - $controller = $factory($this->container->reveal(), ControllerWithMixedConstructorParameters::class); + $controller = $factory($this->container, ControllerWithMixedConstructorParameters::class); $this->assertInstanceOf(ControllerWithMixedConstructorParameters::class, $controller); - $this->assertEquals($config, $controller->config); + $this->assertEquals(['foo' => 'bar'], $controller->config); $this->assertNull($controller->foo); $this->assertEquals([], $controller->options); - $this->assertSame($sample, $controller->sample); - $this->assertSame($validators, $controller->validators); + $this->assertInstanceOf(SampleInterface::class, $controller->sample); + $this->assertInstanceOf(ValidatorPluginManager::class, $controller->validators); } } diff --git a/test/DispatchListenerTest.php b/test/DispatchListenerTest.php index 9ddd05be..8079abe4 100644 --- a/test/DispatchListenerTest.php +++ b/test/DispatchListenerTest.php @@ -21,25 +21,23 @@ class DispatchListenerTest extends TestCase { - use ProphecyTrait; - - public function createMvcEvent($controllerMatched) + private function createMvcEvent($controllerMatched) { $response = new Response(); - $routeMatch = $this->prophesize(RouteMatch::class); - $routeMatch->getParam('controller', 'not-found')->willReturn('path'); + $routeMatch = $this->createMock(RouteMatch::class); + $routeMatch->method('getParam')->with('controller', 'not-found')->willReturn('path'); $eventManager = new EventManager(); - $application = $this->prophesize(Application::class); - $application->getEventManager()->willReturn($eventManager); - $application->getResponse()->willReturn($response); + $application = $this->createMock(Application::class); + $application->method('getEventManager')->willReturn($eventManager); + $application->method('getResponse')->willReturn($response); $event = new MvcEvent(); $event->setRequest(new Request()); $event->setResponse($response); - $event->setApplication($application->reveal()); - $event->setRouteMatch($routeMatch->reveal()); + $event->setApplication($application); + $event->setRouteMatch($routeMatch); return $event; } diff --git a/test/Service/HttpMethodListenerFactoryTest.php b/test/Service/HttpMethodListenerFactoryTest.php index f3ee1f97..225ed704 100644 --- a/test/Service/HttpMethodListenerFactoryTest.php +++ b/test/Service/HttpMethodListenerFactoryTest.php @@ -14,38 +14,29 @@ */ class HttpMethodListenerFactoryTest extends TestCase { - use ProphecyTrait; - - /** - * @var ServiceLocatorInterface|MockObject - */ - protected $serviceLocator; - - public function setUp(): void - { - $this->serviceLocator = $this->prophesize(ServiceLocatorInterface::class); - $this->serviceLocator->willImplement(ContainerInterface::class); - } - public function testCreateWithDefaults() { + $serviceLocator = $this->createMock(ServiceLocatorInterface::class); $factory = new HttpMethodListenerFactory(); - $listener = $factory($this->serviceLocator->reveal(), 'HttpMethodListener'); + $listener = $factory($serviceLocator, 'HttpMethodListener'); $this->assertTrue($listener->isEnabled()); $this->assertNotEmpty($listener->getAllowedMethods()); } public function testCreateWithConfig() { - $config['http_methods_listener'] = [ - 'enabled' => false, - 'allowed_methods' => ['FOO', 'BAR'] + $config = [ + 'http_methods_listener' => [ + 'enabled' => false, + 'allowed_methods' => ['FOO', 'BAR'] + ] ]; - $this->serviceLocator->get('config')->willReturn($config); + $serviceLocator = $this->createMock(ServiceLocatorInterface::class); + $serviceLocator->method('get')->with('config')->willReturn($config); $factory = new HttpMethodListenerFactory(); - $listener = $factory($this->serviceLocator->reveal(), 'HttpMethodListener'); + $listener = $factory($serviceLocator, 'HttpMethodListener'); $listenerConfig = $config['http_methods_listener']; diff --git a/test/Service/InjectTemplateListenerFactoryTest.php b/test/Service/InjectTemplateListenerFactoryTest.php index fd7fb370..19880ba3 100644 --- a/test/Service/InjectTemplateListenerFactoryTest.php +++ b/test/Service/InjectTemplateListenerFactoryTest.php @@ -17,8 +17,6 @@ */ class InjectTemplateListenerFactoryTest extends TestCase { - use ProphecyTrait; - public function testFactoryCanCreateInjectTemplateListener() { $this->buildInjectTemplateListenerWithConfig([]); @@ -52,17 +50,15 @@ public function testFactoryCanSetControllerMapViaArrayAccessVM() } /** - * @return \PHPUnit_Framework_MockObject_MockObject|InjectTemplateListener + * @return \PHPUnit\Framework\MockObject\MockObject|InjectTemplateListener */ private function buildInjectTemplateListenerWithConfig(mixed $config) { - $serviceLocator = $this->prophesize(ServiceLocatorInterface::class); - $serviceLocator->willImplement(ContainerInterface::class); - - $serviceLocator->get('config')->willReturn($config); + $serviceLocator = $this->createMock(ServiceLocatorInterface::class); + $serviceLocator->method('get')->willReturn($config); $factory = new InjectTemplateListenerFactory(); - $listener = $factory($serviceLocator->reveal(), 'InjectTemplateListener'); + $listener = $factory($serviceLocator, 'InjectTemplateListener'); $this->assertInstanceOf(InjectTemplateListener::class, $listener); diff --git a/test/Service/RequestFactoryTest.php b/test/Service/RequestFactoryTest.php index e44ac164..f7de8fd4 100644 --- a/test/Service/RequestFactoryTest.php +++ b/test/Service/RequestFactoryTest.php @@ -10,12 +10,11 @@ class RequestFactoryTest extends TestCase { - use ProphecyTrait; - public function testFactoryCreatesHttpRequest() { $factory = new RequestFactory(); - $request = $factory($this->prophesize(ContainerInterface::class)->reveal(), 'Request'); + $container = $this->createMock(ContainerInterface::class); + $request = $factory($container, 'Request'); $this->assertInstanceOf(HttpRequest::class, $request); } } diff --git a/test/Service/ResponseFactoryTest.php b/test/Service/ResponseFactoryTest.php index 44e71b0c..05a6e087 100644 --- a/test/Service/ResponseFactoryTest.php +++ b/test/Service/ResponseFactoryTest.php @@ -10,12 +10,11 @@ class ResponseFactoryTest extends TestCase { - use ProphecyTrait; - public function testFactoryCreatesHttpResponse() { + $container = $this->createMock(ContainerInterface::class); $factory = new ResponseFactory(); - $response = $factory($this->prophesize(ContainerInterface::class)->reveal(), 'Response'); + $response = $factory($container, 'Response'); $this->assertInstanceOf(HttpResponse::class, $response); } } diff --git a/test/Service/SendResponseListenerFactoryTest.php b/test/Service/SendResponseListenerFactoryTest.php index 84399a73..1d1edf92 100644 --- a/test/Service/SendResponseListenerFactoryTest.php +++ b/test/Service/SendResponseListenerFactoryTest.php @@ -17,37 +17,42 @@ class SendResponseListenerFactoryTest extends TestCase { - use ProphecyTrait; - public function testFactoryReturnsListenerWithEventManagerFromContainer() { - $sharedEvents = $this->prophesize(SharedEventManagerInterface::class); - $events = $this->prophesize(EventManagerInterface::class); - $events->getSharedManager()->will([$sharedEvents, 'reveal']); + $sharedEvents = $this->createMock(SharedEventManagerInterface::class); + $events = $this->createMock(EventManagerInterface::class); + $events->method('getSharedManager')->willReturn($sharedEvents); + + $events->expects($this->once()) + ->method('setIdentifiers') + ->with([SendResponseListener::class, SendResponseListener::class]); - $events->setIdentifiers([SendResponseListener::class, SendResponseListener::class])->shouldBeCalled(); - $events->attach( - SendResponseEvent::EVENT_SEND_RESPONSE, - Argument::type(PhpEnvironmentResponseSender::class), - -1000 - )->shouldBeCalled(); - $events->attach( - SendResponseEvent::EVENT_SEND_RESPONSE, - Argument::type(SimpleStreamResponseSender::class), - -3000 - )->shouldBeCalled(); - $events->attach( - SendResponseEvent::EVENT_SEND_RESPONSE, - Argument::type(HttpResponseSender::class), - -4000 - )->shouldBeCalled(); + $events->expects($this->exactly(3)) + ->method('attach') + ->withConsecutive( + [ + SendResponseEvent::EVENT_SEND_RESPONSE, + $this->isInstanceOf(PhpEnvironmentResponseSender::class), + -1000, + ], + [ + SendResponseEvent::EVENT_SEND_RESPONSE, + $this->isInstanceOf(SimpleStreamResponseSender::class), + -3000, + ], + [ + SendResponseEvent::EVENT_SEND_RESPONSE, + $this->isInstanceOf(HttpResponseSender::class), + -4000, + ], + ); - $container = $this->prophesize(ContainerInterface::class); - $container->get('EventManager')->will([$events, 'reveal']); + $container = $this->createMock(ContainerInterface::class); + $container->method('get')->with('EventManager')->willReturn($events); $factory = new SendResponseListenerFactory(); - $listener = $factory($container->reveal()); + $listener = $factory($container); $this->assertInstanceOf(SendResponseListener::class, $listener); - $this->assertSame($events->reveal(), $listener->getEventManager()); + $this->assertSame($events, $listener->getEventManager()); } } diff --git a/test/Service/ViewFeedStrategyFactoryTest.php b/test/Service/ViewFeedStrategyFactoryTest.php index 45ba922b..0f915fac 100644 --- a/test/Service/ViewFeedStrategyFactoryTest.php +++ b/test/Service/ViewFeedStrategyFactoryTest.php @@ -11,14 +11,12 @@ class ViewFeedStrategyFactoryTest extends TestCase { - use ProphecyTrait; - private function createContainer() { - $renderer = $this->prophesize(FeedRenderer::class); - $container = $this->prophesize(ContainerInterface::class); - $container->get('ViewFeedRenderer')->will(static fn(): object => $renderer->reveal()); - return $container->reveal(); + $renderer = $this->createMock(FeedRenderer::class); + $container = $this->createMock(ContainerInterface::class); + $container->method('get')->with('ViewFeedRenderer')->willReturn($renderer); + return $container; } public function testReturnsFeedStrategy() diff --git a/test/Service/ViewHelperManagerFactoryTest.php b/test/Service/ViewHelperManagerFactoryTest.php index 57ec81e2..bfc66136 100644 --- a/test/Service/ViewHelperManagerFactoryTest.php +++ b/test/Service/ViewHelperManagerFactoryTest.php @@ -74,18 +74,18 @@ public function testUrlHelperFactoryCanBeInvokedViaShortNameOrFullClassName($nam __FUNCTION__ )); - $routeMatch = $this->prophesize(RouteMatch::class)->reveal(); - $mvcEvent = $this->prophesize(MvcEvent::class); - $mvcEvent->getRouteMatch()->willReturn($routeMatch); + $routeMatch = $this->createMock(RouteMatch::class); + $mvcEvent = $this->createMock(MvcEvent::class); + $mvcEvent->method('getRouteMatch')->willReturn($routeMatch); - $application = $this->prophesize(Application::class); - $application->getMvcEvent()->willReturn($mvcEvent->reveal()); + $application = $this->createMock(Application::class); + $application->method('getMvcEvent')->willReturn($mvcEvent); - $router = $this->prophesize(RouteStackInterface::class)->reveal(); + $router = $this->createMock(RouteStackInterface::class); $this->services->setService('HttpRouter', $router); $this->services->setService('Router', $router); - $this->services->setService('Application', $application->reveal()); + $this->services->setService('Application', $application); $this->services->setService('config', []); $manager = $this->factory->__invoke($this->services, HelperPluginManager::class); @@ -111,9 +111,9 @@ public function basePathConfiguration() 'request-base' => [[ 'config' => [], // fails creating plugin manager without this 'Request' => function (): object { - $request = $this->prophesize(Request::class); - $request->getBasePath()->willReturn('/foo/bat'); - return $request->reveal(); + $request = $this->createMock(Request::class); + $request->method('getBasePath')->willReturn('/foo/bat'); + return $request; }, ], '/foo/bat'], ]; diff --git a/test/Service/ViewJsonStrategyFactoryTest.php b/test/Service/ViewJsonStrategyFactoryTest.php index 93875624..6619d779 100644 --- a/test/Service/ViewJsonStrategyFactoryTest.php +++ b/test/Service/ViewJsonStrategyFactoryTest.php @@ -11,14 +11,12 @@ class ViewJsonStrategyFactoryTest extends TestCase { - use ProphecyTrait; - private function createContainer() { - $renderer = $this->prophesize(JsonRenderer::class); - $container = $this->prophesize(ContainerInterface::class); - $container->get('ViewJsonRenderer')->will(static fn(): object => $renderer->reveal()); - return $container->reveal(); + $renderer = $this->createMock(JsonRenderer::class); + $container = $this->createMock(ContainerInterface::class); + $container->method('get')->with('ViewJsonRenderer')->willReturn($renderer); + return $container; } public function testReturnsJsonStrategy() diff --git a/test/Service/ViewManagerFactoryTest.php b/test/Service/ViewManagerFactoryTest.php index 366b1402..0c9d021b 100644 --- a/test/Service/ViewManagerFactoryTest.php +++ b/test/Service/ViewManagerFactoryTest.php @@ -6,18 +6,15 @@ use Laminas\Mvc\Service\ViewManagerFactory; use Laminas\Mvc\View\Http\ViewManager as HttpViewManager; use PHPUnit\Framework\TestCase; -use Prophecy\PhpUnit\ProphecyTrait; class ViewManagerFactoryTest extends TestCase { - use ProphecyTrait; - private function createContainer() { - $http = $this->prophesize(HttpViewManager::class); - $container = $this->prophesize(ContainerInterface::class); - $container->get('HttpViewManager')->will(static fn(): object => $http->reveal()); - return $container->reveal(); + $http = $this->createMock(HttpViewManager::class); + $container = $this->createMock(ContainerInterface::class); + $container->method('get')->with('HttpViewManager')->willReturn($http); + return $container; } public function testReturnsHttpViewManager() diff --git a/test/Service/ViewPrefixPathStackResolverFactoryTest.php b/test/Service/ViewPrefixPathStackResolverFactoryTest.php index 5cf37d3a..22d30c3a 100644 --- a/test/Service/ViewPrefixPathStackResolverFactoryTest.php +++ b/test/Service/ViewPrefixPathStackResolverFactoryTest.php @@ -11,14 +11,10 @@ class ViewPrefixPathStackResolverFactoryTest extends TestCase { - use ProphecyTrait; - public function testCreateService() { - $serviceLocator = $this->prophesize(ServiceLocatorInterface::class); - $serviceLocator->willImplement(ContainerInterface::class); - - $serviceLocator->get('config')->willReturn([ + $serviceLocator = $this->createMock(ServiceLocatorInterface::class); + $serviceLocator->method('get')->willReturn([ 'view_manager' => [ 'prefix_template_path_stack' => [ 'album/' => [], @@ -27,7 +23,7 @@ public function testCreateService() ]); $factory = new ViewPrefixPathStackResolverFactory(); - $resolver = $factory($serviceLocator->reveal(), 'ViewPrefixPathStackResolver'); + $resolver = $factory($serviceLocator, 'ViewPrefixPathStackResolver'); $this->assertInstanceOf(PrefixPathStackResolver::class, $resolver); } From db3b635413d89fec60aa7ef9e881f340d9d55c20 Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 12:59:37 +0100 Subject: [PATCH 03/13] Migrate to phpunit 10 Signed-off-by: fezfez --- composer.json | 2 +- composer.lock | 587 +++++++----------- ...llerTypeShouldTriggerDispatchErrorTest.php | 2 +- .../Application/Controller/PathController.php | 2 +- test/ApplicationTest.php | 18 +- .../LazyControllerAbstractFactoryTest.php | 2 +- .../Plugin/TestAsset/SamplePluginFactory.php | 2 +- .../SamplePluginWithConstructorFactory.php | 2 +- test/Controller/RestfulControllerTest.php | 6 +- .../ControllerLoaderAbstractFactory.php | 2 +- ...ntrollerWithMixedConstructorParameters.php | 2 +- .../TestAsset/UneventfulController.php | 2 +- ...catableControllerLoaderAbstractFactory.php | 2 +- .../UnlocatableEventfulController.php | 2 +- .../AbstractResponseSenderTest.php | 4 +- .../PhpEnvironmentResponseSenderTest.php | 2 +- .../SimpleStreamResponseSenderTest.php | 2 +- test/SendResponseListenerTest.php | 2 +- .../SendResponseListenerFactoryTest.php | 44 +- test/Service/ServiceListenerFactoryTest.php | 2 +- test/Service/ServiceManagerConfigTest.php | 4 +- .../TestAsset/ControllerWithDependencies.php | 2 +- test/Service/ViewHelperManagerFactoryTest.php | 6 +- test/TestAsset/Locator.php | 2 +- test/TestAsset/MiddlewareAbstractFactory.php | 2 +- test/TestAsset/PathController.php | 2 +- test/View/CreateViewModelListenerTest.php | 2 +- test/View/RouteNotFoundStrategyTest.php | 2 +- 28 files changed, 301 insertions(+), 410 deletions(-) diff --git a/composer.json b/composer.json index 57c194e7..ac1b540e 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "require-dev": { "laminas/laminas-coding-standard": "^2.5.0", "laminas/laminas-json": "^3.6", - "phpunit/phpunit": "^9.6.13", + "phpunit/phpunit": "^10.5.38", "webmozart/assert": "^1.11" }, "suggest": { diff --git a/composer.lock b/composer.lock index 432e830f..6aff9eed 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "264aa3f1e4135ef7d787b4f56e01cec2", + "content-hash": "4e3a1dca59582d15a2d6e1c877ace1cd", "packages": [ { "name": "brick/varexporter", @@ -1264,76 +1264,6 @@ }, "time": "2022-02-04T12:51:07+00:00" }, - { - "name": "doctrine/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:23:10+00:00" - }, { "name": "laminas/laminas-coding-standard", "version": "2.5.0", @@ -1614,16 +1544,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.32", + "version": "10.1.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + "reference": "7e308268858ed6baedc8704a304727d20bc07c77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77", "shasum": "" }, "require": { @@ -1631,18 +1561,18 @@ "ext-libxml": "*", "ext-xmlwriter": "*", "nikic/php-parser": "^4.19.1 || ^5.1.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-text-template": "^2.0.4", - "sebastian/code-unit-reverse-lookup": "^2.0.3", - "sebastian/complexity": "^2.0.3", - "sebastian/environment": "^5.1.5", - "sebastian/lines-of-code": "^1.0.4", - "sebastian/version": "^3.0.2", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-text-template": "^3.0.1", + "sebastian/code-unit-reverse-lookup": "^3.0.0", + "sebastian/complexity": "^3.2.0", + "sebastian/environment": "^6.1.0", + "sebastian/lines-of-code": "^2.0.2", + "sebastian/version": "^4.0.1", "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -1651,7 +1581,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "9.2.x-dev" + "dev-main": "10.1.x-dev" } }, "autoload": { @@ -1680,7 +1610,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16" }, "funding": [ { @@ -1688,32 +1618,32 @@ "type": "github" } ], - "time": "2024-08-22T04:23:01+00:00" + "time": "2024-08-22T04:31:57+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1740,7 +1670,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -1748,28 +1679,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2023-08-31T06:24:48+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcntl": "*" @@ -1777,7 +1708,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1803,7 +1734,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" }, "funding": [ { @@ -1811,32 +1742,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2023-02-03T06:56:09+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1862,7 +1793,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -1870,32 +1802,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2023-08-31T14:07:24+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1921,7 +1853,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" }, "funding": [ { @@ -1929,24 +1861,23 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2023-02-03T06:57:52+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.21", + "version": "10.5.38", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa" + "reference": "a86773b9e887a67bc53efa9da9ad6e3f2498c132" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a86773b9e887a67bc53efa9da9ad6e3f2498c132", + "reference": "a86773b9e887a67bc53efa9da9ad6e3f2498c132", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -1956,27 +1887,26 @@ "myclabs/deep-copy": "^1.12.0", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.32", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.4", - "phpunit/php-timer": "^5.0.3", - "sebastian/cli-parser": "^1.0.2", - "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.6", - "sebastian/environment": "^5.1.5", - "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.7", - "sebastian/object-enumerator": "^4.0.4", - "sebastian/resource-operations": "^3.0.4", - "sebastian/type": "^3.2.1", - "sebastian/version": "^3.0.2" + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.16", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-invoker": "^4.0.0", + "phpunit/php-text-template": "^3.0.1", + "phpunit/php-timer": "^6.0.0", + "sebastian/cli-parser": "^2.0.1", + "sebastian/code-unit": "^2.0.0", + "sebastian/comparator": "^5.0.3", + "sebastian/diff": "^5.1.1", + "sebastian/environment": "^6.1.0", + "sebastian/exporter": "^5.1.2", + "sebastian/global-state": "^6.0.2", + "sebastian/object-enumerator": "^5.0.0", + "sebastian/recursion-context": "^5.0.0", + "sebastian/type": "^4.0.0", + "sebastian/version": "^4.0.1" }, "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -1984,7 +1914,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "10.5-dev" } }, "autoload": { @@ -2016,7 +1946,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.38" }, "funding": [ { @@ -2032,32 +1962,32 @@ "type": "tidelift" } ], - "time": "2024-09-19T10:50:18+00:00" + "time": "2024-10-28T13:06:21+00:00" }, { "name": "sebastian/cli-parser", - "version": "1.0.2", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2080,7 +2010,8 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" }, "funding": [ { @@ -2088,32 +2019,32 @@ "type": "github" } ], - "time": "2024-03-02T06:27:43+00:00" + "time": "2024-03-02T07:12:49+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2136,7 +2067,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" }, "funding": [ { @@ -2144,32 +2075,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2023-02-03T06:58:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2191,7 +2122,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" }, "funding": [ { @@ -2199,34 +2130,36 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2023-02-03T06:59:15+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e", + "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -2265,7 +2198,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.3" }, "funding": [ { @@ -2273,33 +2207,33 @@ "type": "github" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2024-10-18T14:56:07+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.3", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + "reference": "68ff824baeae169ec9f2137158ee529584553799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", "shasum": "" }, "require": { "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.2-dev" } }, "autoload": { @@ -2322,7 +2256,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" }, "funding": [ { @@ -2330,33 +2265,33 @@ "type": "github" } ], - "time": "2023-12-22T06:19:30+00:00" + "time": "2023-12-21T08:37:17+00:00" }, { "name": "sebastian/diff", - "version": "4.0.6", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" + "phpunit/phpunit": "^10.0", + "symfony/process": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -2388,7 +2323,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" }, "funding": [ { @@ -2396,27 +2332,27 @@ "type": "github" } ], - "time": "2024-03-02T06:30:58+00:00" + "time": "2024-03-02T07:15:17+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-posix": "*" @@ -2424,7 +2360,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -2443,7 +2379,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -2451,7 +2387,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" }, "funding": [ { @@ -2459,34 +2396,34 @@ "type": "github" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2024-03-23T08:47:14+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.6", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + "reference": "955288482d97c19a372d3f31006ab3f37da47adf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -2528,7 +2465,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" }, "funding": [ { @@ -2536,38 +2474,35 @@ "type": "github" } ], - "time": "2024-03-02T06:33:00+00:00" + "time": "2024-03-02T07:17:12+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.7", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2586,13 +2521,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" }, "funding": [ { @@ -2600,33 +2536,33 @@ "type": "github" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2024-03-02T07:19:19+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.4", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", "shasum": "" }, "require": { "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2649,7 +2585,8 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" }, "funding": [ { @@ -2657,34 +2594,34 @@ "type": "github" } ], - "time": "2023-12-22T06:20:34+00:00" + "time": "2023-12-21T08:38:20+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -2706,7 +2643,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" }, "funding": [ { @@ -2714,32 +2651,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2023-02-03T07:08:32+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2761,7 +2698,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" }, "funding": [ { @@ -2769,32 +2706,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2023-02-03T07:06:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -2824,61 +2761,7 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" }, "funding": [ { @@ -2886,32 +2769,32 @@ "type": "github" } ], - "time": "2024-03-14T16:00:52+00:00" + "time": "2023-02-03T07:05:40+00:00" }, { "name": "sebastian/type", - "version": "3.2.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2934,7 +2817,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { @@ -2942,29 +2825,29 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2987,7 +2870,7 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { @@ -2995,7 +2878,7 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "slevomat/coding-standard", diff --git a/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php b/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php index aa8f82ac..c64ecfcd 100644 --- a/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php +++ b/test/Application/InvalidControllerTypeShouldTriggerDispatchErrorTest.php @@ -6,7 +6,7 @@ use Laminas\Mvc\MvcEvent; use PHPUnit\Framework\TestCase; -class InvalidControllerTypeShouldTrigerDispatchErrorTest extends TestCase +class InvalidControllerTypeShouldTriggerDispatchErrorTest extends TestCase { use InvalidControllerTypeTrait; diff --git a/test/Application/TestAsset/modules/Application/src/Application/Controller/PathController.php b/test/Application/TestAsset/modules/Application/src/Application/Controller/PathController.php index aaac9c2f..c8ad2e04 100644 --- a/test/Application/TestAsset/modules/Application/src/Application/Controller/PathController.php +++ b/test/Application/TestAsset/modules/Application/src/Application/Controller/PathController.php @@ -9,7 +9,7 @@ class PathController implements DispatchableInterface { - public function dispatch(Request $request, Response $response = null) + public function dispatch(Request $request, ?Response $response = null) { if (! $response) { $response = new HttpResponse(); diff --git a/test/ApplicationTest.php b/test/ApplicationTest.php index 21427ad9..4faeb294 100644 --- a/test/ApplicationTest.php +++ b/test/ApplicationTest.php @@ -193,7 +193,7 @@ public function testBootstrapRegistersListeners($listenerServiceName, $event, $m $this->assertContains([$listenerService, $method], $listeners); } - public function bootstrapRegistersListenersProvider() + public static function bootstrapRegistersListenersProvider() { // @codingStandardsIgnoreStart // [ Service Name, Event, Method, isCustom ] @@ -560,13 +560,13 @@ public function testFailedRoutingShouldBePreventable() $response = $this->createMock(ResponseInterface::class); $finishMock = $this->getMockBuilder(stdClass::class) - ->setMethods(['__invoke']) + ->addMethods(['__invoke']) ->getMock(); $routeMock = $this->getMockBuilder(stdClass::class) - ->setMethods(['__invoke']) + ->addMethods(['__invoke']) ->getMock(); $dispatchMock = $this->getMockBuilder(stdClass::class) - ->setMethods(['__invoke']) + ->addMethods(['__invoke']) ->getMock(); $routeMock->expects($this->once())->method('__invoke')->will( @@ -596,16 +596,16 @@ public function testCanRecoverFromApplicationError() $response = $this->createMock(ResponseInterface::class); $errorMock = $this->getMockBuilder(stdClass::class) - ->setMethods(['__invoke']) + ->addMethods(['__invoke']) ->getMock(); $finishMock = $this->getMockBuilder(stdClass::class) - ->setMethods(['__invoke']) + ->addMethods(['__invoke']) ->getMock(); $routeMock = $this->getMockBuilder(stdClass::class) - ->setMethods(['__invoke']) + ->addMethods(['__invoke']) ->getMock(); $dispatchMock = $this->getMockBuilder(stdClass::class) - ->setMethods(['__invoke']) + ->addMethods(['__invoke']) ->getMock(); $errorMock->expects($this->once())->method('__invoke')->will( @@ -639,7 +639,7 @@ public function testCanRecoverFromApplicationError() $this->assertSame($response, $this->application->getMvcEvent()->getResponse()); } - public function eventPropagation() + public static function eventPropagation() { return [ 'route' => [[MvcEvent::EVENT_ROUTE]], diff --git a/test/Controller/LazyControllerAbstractFactoryTest.php b/test/Controller/LazyControllerAbstractFactoryTest.php index e3bb20fd..d1b31342 100644 --- a/test/Controller/LazyControllerAbstractFactoryTest.php +++ b/test/Controller/LazyControllerAbstractFactoryTest.php @@ -29,7 +29,7 @@ public function setUp(): void $this->container = $this->createMock(ContainerInterface::class); } - public function nonClassRequestedNames() + public static function nonClassRequestedNames() { return [ 'non-class-string' => ['non-class-string'], diff --git a/test/Controller/Plugin/TestAsset/SamplePluginFactory.php b/test/Controller/Plugin/TestAsset/SamplePluginFactory.php index 7824b306..deed1471 100644 --- a/test/Controller/Plugin/TestAsset/SamplePluginFactory.php +++ b/test/Controller/Plugin/TestAsset/SamplePluginFactory.php @@ -7,7 +7,7 @@ class SamplePluginFactory implements FactoryInterface { - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { return new SamplePlugin(); } diff --git a/test/Controller/Plugin/TestAsset/SamplePluginWithConstructorFactory.php b/test/Controller/Plugin/TestAsset/SamplePluginWithConstructorFactory.php index d2897373..95ebc987 100644 --- a/test/Controller/Plugin/TestAsset/SamplePluginWithConstructorFactory.php +++ b/test/Controller/Plugin/TestAsset/SamplePluginWithConstructorFactory.php @@ -9,7 +9,7 @@ class SamplePluginWithConstructorFactory implements FactoryInterface { protected $options; - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { return new SamplePluginWithConstructor($options); } diff --git a/test/Controller/RestfulControllerTest.php b/test/Controller/RestfulControllerTest.php index 81ef3d9b..220b5976 100644 --- a/test/Controller/RestfulControllerTest.php +++ b/test/Controller/RestfulControllerTest.php @@ -417,7 +417,7 @@ public function testParsingDataAsJsonWillReturnAsArray() $this->assertEquals(['entity' => ['foo' => 'bar']], $result); } - public function matchingContentTypes() + public static function matchingContentTypes() { return [ 'exact-first' => ['application/hal+json'], @@ -439,7 +439,7 @@ public function testRequestingContentTypeReturnsTrueForValidMatches($contentType )); } - public function nonMatchingContentTypes() + public static function nonMatchingContentTypes() { return [ 'specific-type' => ['application/xml'], @@ -529,7 +529,7 @@ public function testNotImplementedMethodSets504HttpCode($method, $content, array $this->assertEquals('Method Not Allowed', $this->response->getReasonPhrase()); } - public function providerNotImplementedMethodSets504HttpCodeProvider() + public static function providerNotImplementedMethodSets504HttpCodeProvider() { return [ ['DELETE', [], ['id' => 1]], // AbstractRestfulController::delete() diff --git a/test/Controller/TestAsset/ControllerLoaderAbstractFactory.php b/test/Controller/TestAsset/ControllerLoaderAbstractFactory.php index 3a17427c..3a0e5d71 100644 --- a/test/Controller/TestAsset/ControllerLoaderAbstractFactory.php +++ b/test/Controller/TestAsset/ControllerLoaderAbstractFactory.php @@ -22,7 +22,7 @@ public function canCreate(ContainerInterface $container, $name) return class_exists($classname); } - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $classname = $this->classmap[$name]; return new $classname; diff --git a/test/Controller/TestAsset/ControllerWithMixedConstructorParameters.php b/test/Controller/TestAsset/ControllerWithMixedConstructorParameters.php index 2d215632..862b879d 100644 --- a/test/Controller/TestAsset/ControllerWithMixedConstructorParameters.php +++ b/test/Controller/TestAsset/ControllerWithMixedConstructorParameters.php @@ -18,7 +18,7 @@ public function __construct( ValidatorPluginManager $validators, array $config, $foo, - array $options = null + ?array $options = null ) { $this->sample = $sample; $this->validators = $validators; diff --git a/test/Controller/TestAsset/UneventfulController.php b/test/Controller/TestAsset/UneventfulController.php index 7e3fb7f6..04c25f75 100644 --- a/test/Controller/TestAsset/UneventfulController.php +++ b/test/Controller/TestAsset/UneventfulController.php @@ -8,7 +8,7 @@ class UneventfulController implements DispatchableInterface { - public function dispatch(RequestInterface $request, Response $response = null) + public function dispatch(RequestInterface $request, ?Response $response = null) { } } diff --git a/test/Controller/TestAsset/UnlocatableControllerLoaderAbstractFactory.php b/test/Controller/TestAsset/UnlocatableControllerLoaderAbstractFactory.php index cf4d477e..0501c0a6 100644 --- a/test/Controller/TestAsset/UnlocatableControllerLoaderAbstractFactory.php +++ b/test/Controller/TestAsset/UnlocatableControllerLoaderAbstractFactory.php @@ -12,7 +12,7 @@ public function canCreate(ContainerInterface $container, $name) return false; } - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { } } diff --git a/test/Controller/TestAsset/UnlocatableEventfulController.php b/test/Controller/TestAsset/UnlocatableEventfulController.php index b53734d1..83ccc61d 100644 --- a/test/Controller/TestAsset/UnlocatableEventfulController.php +++ b/test/Controller/TestAsset/UnlocatableEventfulController.php @@ -22,7 +22,7 @@ public function getEvent() return $this->event; } - public function dispatch(Request $request, Response $response = null) + public function dispatch(Request $request, ?Response $response = null) { } } diff --git a/test/ResponseSender/AbstractResponseSenderTest.php b/test/ResponseSender/AbstractResponseSenderTest.php index 3daf9606..25f79b72 100644 --- a/test/ResponseSender/AbstractResponseSenderTest.php +++ b/test/ResponseSender/AbstractResponseSenderTest.php @@ -26,7 +26,7 @@ public function testSendHeadersTwoTimesSendsOnlyOnce() $response->getHeaders()->addHeaders($headers); $mockSendResponseEvent = $this->getMockBuilder(SendResponseEvent::class) - ->setMethods(['getResponse']) + ->onlyMethods(['getResponse']) ->getMock(); $mockSendResponseEvent->expects( @@ -76,7 +76,7 @@ public function testSendHeadersSendsStatusLast() ->will($this->returnValue('X-Test: HTTP/1.1 202 Accepted')); $mockSendResponseEvent = $this->getMockBuilder(SendResponseEvent::class) - ->setMethods(['getResponse']) + ->onlyMethods(['getResponse']) ->getMock(); $mockSendResponseEvent->expects($this->any())->method('getResponse')->will($this->returnValue($mockResponse)); diff --git a/test/ResponseSender/PhpEnvironmentResponseSenderTest.php b/test/ResponseSender/PhpEnvironmentResponseSenderTest.php index e87a090f..77ce409d 100644 --- a/test/ResponseSender/PhpEnvironmentResponseSenderTest.php +++ b/test/ResponseSender/PhpEnvironmentResponseSenderTest.php @@ -45,7 +45,7 @@ protected function getSendResponseEventMock() { $returnValue = false; $mockSendResponseEvent = $this->getMockBuilder(SendResponseEvent::class) - ->setMethods(['getResponse', 'contentSent', 'setContentSent']) + ->onlyMethods(['getResponse', 'contentSent', 'setContentSent']) ->getMock(); $mockSendResponseEvent->expects($this->any()) diff --git a/test/ResponseSender/SimpleStreamResponseSenderTest.php b/test/ResponseSender/SimpleStreamResponseSenderTest.php index 7551c100..454f1382 100644 --- a/test/ResponseSender/SimpleStreamResponseSenderTest.php +++ b/test/ResponseSender/SimpleStreamResponseSenderTest.php @@ -46,7 +46,7 @@ public function testSendResponseTwoTimesPrintsResponseOnlyOnce() protected function getSendResponseEventMock($response) { $mockSendResponseEvent = $this->getMockBuilder(SendResponseEvent::class) - ->setMethods(['getResponse']) + ->onlyMethods(['getResponse']) ->getMock(); $mockSendResponseEvent->expects($this->any())->method('getResponse')->will($this->returnValue($response)); return $mockSendResponseEvent; diff --git a/test/SendResponseListenerTest.php b/test/SendResponseListenerTest.php index 4687011b..f3f1da67 100644 --- a/test/SendResponseListenerTest.php +++ b/test/SendResponseListenerTest.php @@ -32,7 +32,7 @@ static function ($e) use (&$result) : void { ); $mockResponse = $this->getMockForAbstractClass(ResponseInterface::class); $mockMvcEvent = $this->getMockBuilder(MvcEvent::class) - ->setMethods(['getResponse']) + ->onlyMethods(['getResponse']) ->getMock(); $mockMvcEvent->expects($this->any())->method('getResponse')->will($this->returnValue($mockResponse)); $listener->sendResponse($mockMvcEvent); diff --git a/test/Service/SendResponseListenerFactoryTest.php b/test/Service/SendResponseListenerFactoryTest.php index 1d1edf92..f251fe06 100644 --- a/test/Service/SendResponseListenerFactoryTest.php +++ b/test/Service/SendResponseListenerFactoryTest.php @@ -27,25 +27,33 @@ public function testFactoryReturnsListenerWithEventManagerFromContainer() ->method('setIdentifiers') ->with([SendResponseListener::class, SendResponseListener::class]); - $events->expects($this->exactly(3)) + $invokedCount = $this->exactly(3); + $events->expects($invokedCount) ->method('attach') - ->withConsecutive( - [ - SendResponseEvent::EVENT_SEND_RESPONSE, - $this->isInstanceOf(PhpEnvironmentResponseSender::class), - -1000, - ], - [ - SendResponseEvent::EVENT_SEND_RESPONSE, - $this->isInstanceOf(SimpleStreamResponseSender::class), - -3000, - ], - [ - SendResponseEvent::EVENT_SEND_RESPONSE, - $this->isInstanceOf(HttpResponseSender::class), - -4000, - ], - ); + ->willReturnCallback(function ($eventName, callable $listener, $priority = 1) use ($invokedCount) { + if ($invokedCount->numberOfInvocations() === 1) { + self::assertSame($eventName, SendResponseEvent::EVENT_SEND_RESPONSE); + self::assertSame(-1000, $priority); + self::assertInstanceOf(PhpEnvironmentResponseSender::class, $listener); + return; + } + + if ($invokedCount->numberOfInvocations() === 2) { + self::assertSame($eventName, SendResponseEvent::EVENT_SEND_RESPONSE); + self::assertSame(-3000, $priority); + self::assertInstanceOf(SimpleStreamResponseSender::class, $listener); + return; + } + + if ($invokedCount->numberOfInvocations() === 3) { + self::assertSame($eventName, SendResponseEvent::EVENT_SEND_RESPONSE); + self::assertSame(-4000, $priority); + self::assertInstanceOf(HttpResponseSender::class, $listener); + return; + } + + throw new \RuntimeException('Unexpected numberOfInvocations' . $invokedCount->numberOfInvocations()); + }); $container = $this->createMock(ContainerInterface::class); $container->method('get')->with('EventManager')->willReturn($events); diff --git a/test/Service/ServiceListenerFactoryTest.php b/test/Service/ServiceListenerFactoryTest.php index eb9a5893..faba161a 100644 --- a/test/Service/ServiceListenerFactoryTest.php +++ b/test/Service/ServiceListenerFactoryTest.php @@ -15,7 +15,7 @@ class ServiceListenerFactoryTest extends TestCase public function setUp(): void { $this->sm = $this->getMockBuilder(ServiceManager::class) - ->setMethods(['get']) + ->onlyMethods(['get']) ->getMock(); $this->factory = new ServiceListenerFactory(); diff --git a/test/Service/ServiceManagerConfigTest.php b/test/Service/ServiceManagerConfigTest.php index 0f5be168..9ea6da6a 100644 --- a/test/Service/ServiceManagerConfigTest.php +++ b/test/Service/ServiceManagerConfigTest.php @@ -99,7 +99,7 @@ public function testCanAddDelegators() /* * Create delegator closure */ - $delegator = static function ($container, $name, $callback, array $options = null) { + $delegator = static function ($container, $name, $callback, ?array $options = null) { $service = $callback(); $service->bar = 'baz'; return $service; @@ -129,7 +129,7 @@ public function testEventManagerInitializerCanBeReplaced() { $instance = $this->createMock(EventManagerAwareInterface::class); $initializer = $this->getMockBuilder(stdClass::class) - ->setMethods(['__invoke']) + ->addMethods(['__invoke']) ->getMock(); $config = new ServiceManagerConfig([ 'initializers' => [ diff --git a/test/Service/TestAsset/ControllerWithDependencies.php b/test/Service/TestAsset/ControllerWithDependencies.php index f757ce49..32e5fab5 100644 --- a/test/Service/TestAsset/ControllerWithDependencies.php +++ b/test/Service/TestAsset/ControllerWithDependencies.php @@ -19,7 +19,7 @@ public function setInjectedValue(stdClass $injected) $this->injectedValue = $injected; } - public function dispatch(RequestInterface $request, ResponseInterface $response = null) + public function dispatch(RequestInterface $request, ?ResponseInterface $response = null) { } } diff --git a/test/Service/ViewHelperManagerFactoryTest.php b/test/Service/ViewHelperManagerFactoryTest.php index bfc66136..9bcc3605 100644 --- a/test/Service/ViewHelperManagerFactoryTest.php +++ b/test/Service/ViewHelperManagerFactoryTest.php @@ -29,7 +29,7 @@ public function setUp(): void /** * @return array */ - public function emptyConfiguration() + public static function emptyConfiguration() { return [ 'no-config' => [[]], @@ -52,7 +52,7 @@ public function testDoctypeFactoryDoesNotRaiseErrorOnMissingConfiguration($confi $this->assertInstanceof(Doctype::class, $doctype); } - public function urlHelperNames() + public static function urlHelperNames() { return [ ['url'], @@ -148,7 +148,7 @@ public function testBasePathHelperFactoryCanBeInvokedViaShortNameOrFullClassName $this->assertEquals($expected, $helper()); } - public function doctypeHelperNames() + public static function doctypeHelperNames() { return [ ['doctype'], diff --git a/test/TestAsset/Locator.php b/test/TestAsset/Locator.php index 2bd9c043..b73e827a 100644 --- a/test/TestAsset/Locator.php +++ b/test/TestAsset/Locator.php @@ -26,7 +26,7 @@ public function has($name) return (isset($this->services[$name])); } - public function build($name, array $options = null) + public function build($name, ?array $options = null) { if (! isset($this->services[$name])) { throw new ServiceNotFoundException(); diff --git a/test/TestAsset/MiddlewareAbstractFactory.php b/test/TestAsset/MiddlewareAbstractFactory.php index 501b6cca..679a2586 100644 --- a/test/TestAsset/MiddlewareAbstractFactory.php +++ b/test/TestAsset/MiddlewareAbstractFactory.php @@ -21,7 +21,7 @@ public function canCreate(ContainerInterface $container, $name) return class_exists($classname); } - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $classname = $this->classmap[$name]; return new $classname; diff --git a/test/TestAsset/PathController.php b/test/TestAsset/PathController.php index 6729b2eb..16ccbe5d 100644 --- a/test/TestAsset/PathController.php +++ b/test/TestAsset/PathController.php @@ -8,7 +8,7 @@ class PathController implements DispatchableInterface { - public function dispatch(Request $request, Response $response = null) + public function dispatch(Request $request, ?Response $response = null) { if (! $response) { $response = new HttpResponse(); diff --git a/test/View/CreateViewModelListenerTest.php b/test/View/CreateViewModelListenerTest.php index 8b54d702..065c9668 100644 --- a/test/View/CreateViewModelListenerTest.php +++ b/test/View/CreateViewModelListenerTest.php @@ -36,7 +36,7 @@ public function testReCastsAssocArrayEventResultAsViewModel() $this->assertEquals($array, $test->getVariables()); } - public function nonAssocArrayResults() + public static function nonAssocArrayResults() { return [ [null], diff --git a/test/View/RouteNotFoundStrategyTest.php b/test/View/RouteNotFoundStrategyTest.php index 6f21500f..53a5ec4f 100644 --- a/test/View/RouteNotFoundStrategyTest.php +++ b/test/View/RouteNotFoundStrategyTest.php @@ -24,7 +24,7 @@ public function setUp(): void $this->strategy = new RouteNotFoundStrategy(); } - public function notFoundResponseProvider() + public static function notFoundResponseProvider() { return [ ['bar', 'assertEquals'], From 49bb932bee868f25ec3bdffad56d3d4eed79de9d Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 12:59:49 +0100 Subject: [PATCH 04/13] Migrate to phpunit 10 Signed-off-by: fezfez --- phpunit.xml.dist | 54 ++++++++++++++++++++++-------------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index af695d54..b7e0f58a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,34 +1,30 @@ - - - - ./src - - - - - - ./test/ - - - - - - disable - - - - - - - - + + + + + ./src + + From 449fc49738c7449e43840993846b2c63fb7ba0df Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 13:00:15 +0100 Subject: [PATCH 05/13] Fix syntax deprecation in php 8.4 Signed-off-by: fezfez --- src/Controller/AbstractController.php | 4 ++-- src/Controller/AbstractRestfulController.php | 2 +- src/Controller/LazyControllerAbstractFactory.php | 2 +- src/Controller/Plugin/AcceptableViewModelSelector.php | 10 +++++----- src/Controller/Plugin/Forward.php | 2 +- src/Controller/Plugin/Service/ForwardFactory.php | 2 +- src/Controller/PluginManager.php | 2 +- src/ResponseSender/AbstractResponseSender.php | 2 +- src/Service/ConfigFactory.php | 2 +- src/Service/ViewFeedStrategyFactory.php | 2 +- src/Service/ViewJsonStrategyFactory.php | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Controller/AbstractController.php b/src/Controller/AbstractController.php index c7f41c35..d5c781a8 100644 --- a/src/Controller/AbstractController.php +++ b/src/Controller/AbstractController.php @@ -88,7 +88,7 @@ abstract public function onDispatch(MvcEvent $e); * @param null|Response $response * @return Response|mixed */ - public function dispatch(Request $request, Response $response = null) + public function dispatch(Request $request, ?Response $response = null) { $this->request = $request; if (! $response) { @@ -258,7 +258,7 @@ public function setPluginManager(PluginManager $plugins) * @param null|array $options Options to pass to plugin constructor (if not already instantiated) * @return mixed */ - public function plugin($name, array $options = null) + public function plugin($name, ?array $options = null) { return $this->getPluginManager()->get($name, $options); } diff --git a/src/Controller/AbstractRestfulController.php b/src/Controller/AbstractRestfulController.php index ea2cf490..5b3785ec 100644 --- a/src/Controller/AbstractRestfulController.php +++ b/src/Controller/AbstractRestfulController.php @@ -297,7 +297,7 @@ public function notFoundAction() * @return mixed|Response * @throws Exception\InvalidArgumentException */ - public function dispatch(Request $request, Response $response = null) + public function dispatch(Request $request, ?Response $response = null) { if (! $request instanceof HttpRequest) { throw new InvalidArgumentException('Expected an HTTP request'); diff --git a/src/Controller/LazyControllerAbstractFactory.php b/src/Controller/LazyControllerAbstractFactory.php index 55c8a8fa..2f45b1e0 100644 --- a/src/Controller/LazyControllerAbstractFactory.php +++ b/src/Controller/LazyControllerAbstractFactory.php @@ -97,7 +97,7 @@ class LazyControllerAbstractFactory implements AbstractFactoryInterface * * @return DispatchableInterface */ - public function __invoke(ContainerInterface $container, $requestedName, array $options = null) + public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null) { $reflectionClass = new ReflectionClass($requestedName); diff --git a/src/Controller/Plugin/AcceptableViewModelSelector.php b/src/Controller/Plugin/AcceptableViewModelSelector.php index 2e972736..7be16152 100644 --- a/src/Controller/Plugin/AcceptableViewModelSelector.php +++ b/src/Controller/Plugin/AcceptableViewModelSelector.php @@ -57,7 +57,7 @@ class AcceptableViewModelSelector extends AbstractPlugin * @return ModelInterface|null */ public function __invoke( - array $matchAgainst = null, + ?array $matchAgainst = null, $returnDefault = true, &$resultReference = null ) { @@ -74,7 +74,7 @@ public function __invoke( * @return ModelInterface|null */ public function getViewModel( - array $matchAgainst = null, + ?array $matchAgainst = null, $returnDefault = true, &$resultReference = null ) { @@ -100,7 +100,7 @@ public function getViewModel( * @return ModelInterface|null Returns null if $returnDefault = false and no match could be made */ public function getViewModelName( - array $matchAgainst = null, + ?array $matchAgainst = null, $returnDefault = true, &$resultReference = null ) { @@ -121,7 +121,7 @@ public function getViewModelName( * @param array $matchAgainst (optional) The Array to match against * @return AbstractFieldValuePart|null The object that was matched */ - public function match(array $matchAgainst = null) + public function match(?array $matchAgainst = null) { $request = $this->getRequest(); $headers = $request->getHeaders(); @@ -176,7 +176,7 @@ public function getDefaultViewModelName() * @param array $matchAgainst (optional) The Array to match against * @return AcceptableViewModelSelector provides fluent interface */ - public function setDefaultMatchAgainst(array $matchAgainst = null) + public function setDefaultMatchAgainst(?array $matchAgainst = null) { $this->defaultMatchAgainst = $matchAgainst; return $this; diff --git a/src/Controller/Plugin/Forward.php b/src/Controller/Plugin/Forward.php index 8e352c11..0f43273d 100644 --- a/src/Controller/Plugin/Forward.php +++ b/src/Controller/Plugin/Forward.php @@ -101,7 +101,7 @@ public function setListenersToDetach($listeners) * @throws Exception\DomainException if composed controller does not define InjectApplicationEventInterface * or Locator aware; or if the discovered controller is not dispatchable */ - public function dispatch($name, array $params = null) + public function dispatch($name, ?array $params = null) { $event = clone($this->getEvent()); diff --git a/src/Controller/Plugin/Service/ForwardFactory.php b/src/Controller/Plugin/Service/ForwardFactory.php index 6abfb0e0..b2431c02 100644 --- a/src/Controller/Plugin/Service/ForwardFactory.php +++ b/src/Controller/Plugin/Service/ForwardFactory.php @@ -15,7 +15,7 @@ class ForwardFactory implements FactoryInterface * @return Forward * @throws ServiceNotCreatedException if Controllermanager service is not found in application service locator */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { if (! $container->has('ControllerManager')) { throw new ServiceNotCreatedException(sprintf( diff --git a/src/Controller/PluginManager.php b/src/Controller/PluginManager.php index 8cbe652b..fccab54a 100644 --- a/src/Controller/PluginManager.php +++ b/src/Controller/PluginManager.php @@ -113,7 +113,7 @@ class PluginManager extends AbstractPluginManager * @param null|array $options Options to use when creating the instance. * @return DispatchableInterface */ - public function get($name, array $options = null) + public function get($name, ?array $options = null) { $plugin = parent::get($name, $options); $this->injectController($plugin); diff --git a/src/ResponseSender/AbstractResponseSender.php b/src/ResponseSender/AbstractResponseSender.php index c98724a4..39d13498 100644 --- a/src/ResponseSender/AbstractResponseSender.php +++ b/src/ResponseSender/AbstractResponseSender.php @@ -28,7 +28,7 @@ public function sendHeaders(SendResponseEvent $event) } $status = $response->renderStatusLine(); - header($status); + header((string) $status); $event->setHeadersSent(); return $this; diff --git a/src/Service/ConfigFactory.php b/src/Service/ConfigFactory.php index 78ae2b9b..7b5f0849 100644 --- a/src/Service/ConfigFactory.php +++ b/src/Service/ConfigFactory.php @@ -22,7 +22,7 @@ class ConfigFactory implements FactoryInterface * @param null|array $options * @return array|Traversable */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $moduleManager = $container->get('ModuleManager'); $moduleManager->loadModules(); diff --git a/src/Service/ViewFeedStrategyFactory.php b/src/Service/ViewFeedStrategyFactory.php index 24333ac7..0e985ce7 100644 --- a/src/Service/ViewFeedStrategyFactory.php +++ b/src/Service/ViewFeedStrategyFactory.php @@ -21,7 +21,7 @@ class ViewFeedStrategyFactory implements FactoryInterface * @param null|array $options * @return FeedStrategy */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { return new FeedStrategy($container->get('ViewFeedRenderer')); } diff --git a/src/Service/ViewJsonStrategyFactory.php b/src/Service/ViewJsonStrategyFactory.php index 68920929..c8eb3d65 100644 --- a/src/Service/ViewJsonStrategyFactory.php +++ b/src/Service/ViewJsonStrategyFactory.php @@ -21,7 +21,7 @@ class ViewJsonStrategyFactory implements FactoryInterface * @param null|array $options * @return JsonStrategy */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $jsonRenderer = $container->get('ViewJsonRenderer'); $jsonStrategy = new JsonStrategy($jsonRenderer); From 82d27e0959d16644635ca5ff8c80705ca58d7155 Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 13:04:50 +0100 Subject: [PATCH 06/13] Fix syntax deprecation in php 8.4 Signed-off-by: fezfez --- test/Service/ServiceManagerConfigTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Service/ServiceManagerConfigTest.php b/test/Service/ServiceManagerConfigTest.php index 9ea6da6a..f11af743 100644 --- a/test/Service/ServiceManagerConfigTest.php +++ b/test/Service/ServiceManagerConfigTest.php @@ -36,7 +36,7 @@ protected function setUp(): void * @param null|SharedEventManagerInterface * @return EventManager */ - protected function createEventManager(SharedEventManagerInterface $sharedManager = null) + protected function createEventManager(?SharedEventManagerInterface $sharedManager = null) { return new EventManager($sharedManager ?: $this->services->get('SharedEventManager')); } From 183057fbbecc164986bcae0a2299708f7a2c19c3 Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 14:46:51 +0100 Subject: [PATCH 07/13] Clean PHPunit config Signed-off-by: fezfez --- phpunit.xml.dist | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b7e0f58a..ee6bb070 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,7 +3,11 @@ xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" bootstrap="./vendor/autoload.php" colors="true" - cacheDirectory=".phpunit.cache"> + cacheDirectory=".phpunit.cache" + failOnDeprecation="true" + failOnPhpunitDeprecation="true" + failOnNotice="true" + failOnWarning="true"> ./test/ From 0d268e43881170b076df00f6daac026362d1ed53 Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 14:49:09 +0100 Subject: [PATCH 08/13] Clean PHPunit config Signed-off-by: fezfez --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ee6bb070..bec42c6e 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,7 +5,7 @@ colors="true" cacheDirectory=".phpunit.cache" failOnDeprecation="true" - failOnPhpunitDeprecation="true" + failOnPhpunitDeprecation="false" failOnNotice="true" failOnWarning="true"> From a399c070e366aa35c9383c67ae6ebc1ca1869d10 Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 14:53:30 +0100 Subject: [PATCH 09/13] Check if the var is array or iterable before foreach Signed-off-by: fezfez --- src/ResponseSender/AbstractResponseSender.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ResponseSender/AbstractResponseSender.php b/src/ResponseSender/AbstractResponseSender.php index 39d13498..7ed0840b 100644 --- a/src/ResponseSender/AbstractResponseSender.php +++ b/src/ResponseSender/AbstractResponseSender.php @@ -19,12 +19,16 @@ public function sendHeaders(SendResponseEvent $event) $response = $event->getResponse(); - foreach ($response->getHeaders() as $header) { - if ($header instanceof MultipleHeaderInterface) { - header($header->toString(), false); - continue; + $headers = $response->getHeaders(); + + if (is_array($headers) || is_iterable($headers)) { + foreach ($response->getHeaders() as $header) { + if ($header instanceof MultipleHeaderInterface) { + header($header->toString(), false); + continue; + } + header($header->toString()); } - header($header->toString()); } $status = $response->renderStatusLine(); From 8a1860c46bc85866f0cbe08835baa9b483999e6d Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 14:57:22 +0100 Subject: [PATCH 10/13] Clean PHPunit config Signed-off-by: fezfez --- phpunit.xml.dist | 1 - 1 file changed, 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bec42c6e..32a884d2 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,7 +5,6 @@ colors="true" cacheDirectory=".phpunit.cache" failOnDeprecation="true" - failOnPhpunitDeprecation="false" failOnNotice="true" failOnWarning="true"> From 516b2cd2c4a8b99ee80580449dd01de9a255b445 Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 15:47:09 +0100 Subject: [PATCH 11/13] Clean PHPunit config Signed-off-by: fezfez --- phpunit.xml.dist | 7 +- test/DispatchListenerTest.php | 86 +++++++++++++++++-- test/Service/ViewHelperManagerFactoryTest.php | 6 +- 3 files changed, 90 insertions(+), 9 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 32a884d2..1b815360 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,7 +6,12 @@ cacheDirectory=".phpunit.cache" failOnDeprecation="true" failOnNotice="true" - failOnWarning="true"> + failOnWarning="true" + failOnPhpunitDeprecation="true" + displayDetailsOnPhpunitDeprecations="true" + displayDetailsOnTestsThatTriggerDeprecations="true" + displayDetailsOnTestsThatTriggerNotices="true" + displayDetailsOnTestsThatTriggerWarnings="true"> ./test/ diff --git a/test/DispatchListenerTest.php b/test/DispatchListenerTest.php index 8079abe4..15140adb 100644 --- a/test/DispatchListenerTest.php +++ b/test/DispatchListenerTest.php @@ -114,7 +114,7 @@ public function testWillNotDispatchWhenAnMvcEventResultIsAlreadySet(mixed $alrea /** * @return mixed[][] */ - public function alreadySetMvcEventResultProvider() + public static function alreadySetMvcEventResultProvider() { return [ [123], @@ -122,13 +122,89 @@ public function alreadySetMvcEventResultProvider() [false], [[]], [new stdClass()], - [$this], - [$this->createMock(ModelInterface::class)], - [$this->createMock(ResponseInterface::class)], - [$this->createMock(Response::class)], [['view model data' => 'as an array']], [['foo' => new stdClass()]], ['a response string'], ]; } + + public function testWillNotDispatchWhenAnMvcEventResultIsAlreadySetWithModelInterface() : void + { + $alreadySetResult = $this->createMock(ModelInterface::class); + $event = $this->createMvcEvent('path'); + + $event->setResult($alreadySetResult); + + $listener = new DispatchListener(new ControllerManager(new ServiceManager(), ['abstract_factories' => [ + UnlocatableControllerLoaderAbstractFactory::class, + ]])); + + $event->getApplication()->getEventManager()->attach(MvcEvent::EVENT_DISPATCH_ERROR, static function () : void { + self::fail('No dispatch failures should be raised - dispatch should be skipped'); + }); + + $listener->onDispatch($event); + + self::assertSame($alreadySetResult, $event->getResult(), 'The event result was not replaced'); + } + + public function testWillNotDispatchWhenAnMvcEventResultIsAlreadySetWithResponseInterface() : void + { + $alreadySetResult = $this->createMock(ResponseInterface::class); + $event = $this->createMvcEvent('path'); + + $event->setResult($alreadySetResult); + + $listener = new DispatchListener(new ControllerManager(new ServiceManager(), ['abstract_factories' => [ + UnlocatableControllerLoaderAbstractFactory::class, + ]])); + + $event->getApplication()->getEventManager()->attach(MvcEvent::EVENT_DISPATCH_ERROR, static function () : void { + self::fail('No dispatch failures should be raised - dispatch should be skipped'); + }); + + $listener->onDispatch($event); + + self::assertSame($alreadySetResult, $event->getResult(), 'The event result was not replaced'); + } + + public function testWillNotDispatchWhenAnMvcEventResultIsAlreadySetWithResponse() : void + { + $alreadySetResult = $this->createMock(Response::class); + $event = $this->createMvcEvent('path'); + + $event->setResult($alreadySetResult); + + $listener = new DispatchListener(new ControllerManager(new ServiceManager(), ['abstract_factories' => [ + UnlocatableControllerLoaderAbstractFactory::class, + ]])); + + $event->getApplication()->getEventManager()->attach(MvcEvent::EVENT_DISPATCH_ERROR, static function () : void { + self::fail('No dispatch failures should be raised - dispatch should be skipped'); + }); + + $listener->onDispatch($event); + + self::assertSame($alreadySetResult, $event->getResult(), 'The event result was not replaced'); + } + + public function testWillNotDispatchWhenAnMvcEventResultIsAlreadySetWithThis() : void + { + $alreadySetResult = $this; + $event = $this->createMvcEvent('path'); + + $event->setResult($alreadySetResult); + + $listener = new DispatchListener(new ControllerManager(new ServiceManager(), ['abstract_factories' => [ + UnlocatableControllerLoaderAbstractFactory::class, + ]])); + + $event->getApplication()->getEventManager()->attach(MvcEvent::EVENT_DISPATCH_ERROR, static function () : void { + self::fail('No dispatch failures should be raised - dispatch should be skipped'); + }); + + $listener->onDispatch($event); + + self::assertSame($alreadySetResult, $event->getResult(), 'The event result was not replaced'); + } } diff --git a/test/Service/ViewHelperManagerFactoryTest.php b/test/Service/ViewHelperManagerFactoryTest.php index 9bcc3605..af044f63 100644 --- a/test/Service/ViewHelperManagerFactoryTest.php +++ b/test/Service/ViewHelperManagerFactoryTest.php @@ -95,7 +95,7 @@ public function testUrlHelperFactoryCanBeInvokedViaShortNameOrFullClassName($nam $this->assertAttributeSame($router, 'router', $helper, 'Router was not injected'); } - public function basePathConfiguration() + public static function basePathConfiguration() { $names = ['basepath', 'basePath', 'BasePath', BasePath::class, 'laminasviewhelperbasepath']; @@ -111,8 +111,8 @@ public function basePathConfiguration() 'request-base' => [[ 'config' => [], // fails creating plugin manager without this 'Request' => function (): object { - $request = $this->createMock(Request::class); - $request->method('getBasePath')->willReturn('/foo/bat'); + $request = new Request(); + $request->setBasePath('/foo/bat'); return $request; }, ], '/foo/bat'], From 08dbeadb87665b9267a9c967d1ba3e1a6a803bc6 Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 15:57:44 +0100 Subject: [PATCH 12/13] Update lowest version for some package to ensure they work on php 8.4 Signed-off-by: fezfez --- composer.json | 6 +++--- composer.lock | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index ac1b540e..840c8604 100644 --- a/composer.json +++ b/composer.json @@ -32,11 +32,11 @@ "container-interop/container-interop": "^1.2", "laminas/laminas-eventmanager": "^3.4", "laminas/laminas-http": "^2.15", - "laminas/laminas-modulemanager": "^2.8", + "laminas/laminas-modulemanager": "^2.16", "laminas/laminas-router": "^3.11.1", "laminas/laminas-servicemanager": "^3.20.0", - "laminas/laminas-stdlib": "^3.6", - "laminas/laminas-view": "^2.14" + "laminas/laminas-stdlib": "^3.19", + "laminas/laminas-view": "^2.18.0" }, "require-dev": { "laminas/laminas-coding-standard": "^2.5.0", diff --git a/composer.lock b/composer.lock index 6aff9eed..10393baa 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4e3a1dca59582d15a2d6e1c877ace1cd", + "content-hash": "6cbd47c7754a1c96a5080328fde70c2c", "packages": [ { "name": "brick/varexporter", From 331bb5c72bd8498b4b5c4d34511a667a451e2ee1 Mon Sep 17 00:00:00 2001 From: fezfez Date: Thu, 14 Nov 2024 16:14:20 +0100 Subject: [PATCH 13/13] Remove redundant check Signed-off-by: fezfez --- src/ResponseSender/AbstractResponseSender.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ResponseSender/AbstractResponseSender.php b/src/ResponseSender/AbstractResponseSender.php index 7ed0840b..ea27981e 100644 --- a/src/ResponseSender/AbstractResponseSender.php +++ b/src/ResponseSender/AbstractResponseSender.php @@ -21,7 +21,7 @@ public function sendHeaders(SendResponseEvent $event) $headers = $response->getHeaders(); - if (is_array($headers) || is_iterable($headers)) { + if (is_iterable($headers)) { foreach ($response->getHeaders() as $header) { if ($header instanceof MultipleHeaderInterface) { header($header->toString(), false);