From 993067e1871ddf1e24f323aae8234589320e1f53 Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 08:47:10 +0100 Subject: [PATCH 1/7] Fix versions constraints --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 141ee05..ae0e961 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "behat/behat": "~3.0", "squizlabs/php_codesniffer": "3.*", "phpunit/phpunit": "^7.0 || ^8.0", - "matthiasnoback/symfony-dependency-injection-test": "^2.0 || ^3.0", + "matthiasnoback/symfony-dependency-injection-test": "^3.0 || ^4.0", "matthiasnoback/symfony-config-test": "^3.0 || ^4.0", "symfony/framework-bundle": "^3.0 || ^4.0", "symfony/http-kernel": "^3.0 || ^4.0", From d303c29eee776153fed679393c9b4fb19e0277aa Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 09:05:23 +0100 Subject: [PATCH 2/7] Improve --- .travis.yml | 1 + tests/Common/DependencyInjection/AbstractTestClass.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d64e266..4ec5931 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ php: - '7.1' - '7.2' - '7.3' + - '7.4' env: global: diff --git a/tests/Common/DependencyInjection/AbstractTestClass.php b/tests/Common/DependencyInjection/AbstractTestClass.php index ae5004b..e5d45bf 100644 --- a/tests/Common/DependencyInjection/AbstractTestClass.php +++ b/tests/Common/DependencyInjection/AbstractTestClass.php @@ -22,7 +22,7 @@ abstract class AbstractTestClass extends AbstractExtensionTestCase /** * {@inheritdoc} */ - protected function getContainerExtensions() + protected function getContainerExtensions(): array { return [ new JsonRpcHttpServerExtension() From 7bbafe1774e4b8feba5e905dd29e97434524c7df Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 09:09:38 +0100 Subject: [PATCH 3/7] Fix --- tests/Common/DependencyInjection/AbstractTestClass.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Common/DependencyInjection/AbstractTestClass.php b/tests/Common/DependencyInjection/AbstractTestClass.php index e5d45bf..efdb89f 100644 --- a/tests/Common/DependencyInjection/AbstractTestClass.php +++ b/tests/Common/DependencyInjection/AbstractTestClass.php @@ -29,7 +29,7 @@ protected function getContainerExtensions(): array ]; } - protected function load(array $configurationValues = [], $mockResolver = true, $compile = true) + protected function load(array $configurationValues = [], $mockResolver = true, $compile = true): void { // Inject event dispatcher $this->setDefinition('event_dispatcher', new Definition(EventDispatcher::class)); From 63ffae0a7ad88a97fcad468391a689cab678057a Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 09:14:38 +0100 Subject: [PATCH 4/7] Improve --- .../DependencyInjection/AbstractTestClass.php | 2 +- .../DependencyInjection/ConfigFilesTest.php | 4 ++-- .../JsonRpcHttpServerExtensionTest.php | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/Common/DependencyInjection/AbstractTestClass.php b/tests/Common/DependencyInjection/AbstractTestClass.php index efdb89f..7ae993f 100644 --- a/tests/Common/DependencyInjection/AbstractTestClass.php +++ b/tests/Common/DependencyInjection/AbstractTestClass.php @@ -29,7 +29,7 @@ protected function getContainerExtensions(): array ]; } - protected function load(array $configurationValues = [], $mockResolver = true, $compile = true): void + protected function loadContainer(array $configurationValues = [], $mockResolver = true, $compile = true): void { // Inject event dispatcher $this->setDefinition('event_dispatcher', new Definition(EventDispatcher::class)); diff --git a/tests/Functional/DependencyInjection/ConfigFilesTest.php b/tests/Functional/DependencyInjection/ConfigFilesTest.php index 11de2e2..5615711 100644 --- a/tests/Functional/DependencyInjection/ConfigFilesTest.php +++ b/tests/Functional/DependencyInjection/ConfigFilesTest.php @@ -26,7 +26,7 @@ class ConfigFilesTest extends AbstractTestClass /** * {@inheritdoc} */ - protected function getContainerExtensions() + protected function getContainerExtensions(): array { return [ new JsonRpcHttpServerExtension() @@ -44,7 +44,7 @@ protected function getContainerExtensions() */ public function testShouldHaveService($serviceId, $expectedClassName, $public) { - $this->load([], true, false); + $this->loadContainer([], true, false); $this->assertContainerBuilderHasService($serviceId, $expectedClassName); if (true === $public) { diff --git a/tests/Functional/DependencyInjection/JsonRpcHttpServerExtensionTest.php b/tests/Functional/DependencyInjection/JsonRpcHttpServerExtensionTest.php index 2049ca1..0d04c79 100644 --- a/tests/Functional/DependencyInjection/JsonRpcHttpServerExtensionTest.php +++ b/tests/Functional/DependencyInjection/JsonRpcHttpServerExtensionTest.php @@ -19,7 +19,7 @@ class JsonRpcHttpServerExtensionTest extends AbstractTestClass /** * {@inheritdoc} */ - protected function getContainerExtensions() + protected function getContainerExtensions(): array { return [ new JsonRpcHttpServerExtension() @@ -29,7 +29,7 @@ protected function getContainerExtensions() public function testShouldBeLoadable() { - $this->load(); + $this->loadContainer(); $this->assertEndpointIsUsable(); } @@ -37,7 +37,7 @@ public function testShouldBeLoadable() public function testShouldManageCustomEndpointPathFromConfiguration() { $myCustomEndpoint = 'my-custom-endpoint'; - $this->load(['endpoint' => $myCustomEndpoint]); + $this->loadContainer(['endpoint' => $myCustomEndpoint]); // Assert custom resolver is an alias of the stub $this->assertContainerBuilderHasParameter(self::EXPECTED_HTTP_ENDPOINT_PATH_CONTAINER_PARAM, $myCustomEndpoint); @@ -57,7 +57,7 @@ public function testShouldBindServerDispatcherToDispatcherAwareService() $this->setDefinition('my-dispatcher-aware-service', $dispatcherAwareServiceDefinition); - $this->load(); + $this->loadContainer(); // Assert custom resolver is an alias of the stub $this->assertContainerBuilderHasServiceDefinitionWithMethodCall( @@ -85,7 +85,7 @@ public function testShouldThrowAnExceptionIfDispatcherAwareServiceDoesNotUseRigh .'"'.JsonRpcServerDispatcherAwareTrait::class.'"' ); - $this->load(); + $this->loadContainer(); } public function testShouldInjectParamsValidatorAliasIfDefined() @@ -96,7 +96,7 @@ public function testShouldInjectParamsValidatorAliasIfDefined() $this->setDefinition($myValidatorServiceId, $paramsValidator); $this->container->setAlias(self::EXPECTED_PARAMS_VALIDATOR_ALIAS, $myValidatorServiceId); - $this->load(); + $this->loadContainer(); $this->assertContainerBuilderHasServiceDefinitionWithMethodCall( self::EXPECTED_REQUEST_HANDLER_SERVICE_ID, @@ -109,7 +109,7 @@ public function testShouldInjectParamsValidatorAliasIfDefined() public function testShouldNotInjectParamsValidatorAliasIfNotDefined() { - $this->load(); + $this->loadContainer(); $handlerDefinition = $this->container->getDefinition(self::EXPECTED_REQUEST_HANDLER_SERVICE_ID); foreach ($handlerDefinition->getMethodCalls() as $methodCall) { @@ -142,7 +142,7 @@ public function testShouldBindJsonRpcMethodsToMethodAwareServices() $methodAwareDefinition->addTag(JsonRpcHttpServerExtension::JSONRPC_METHOD_AWARE_TAG); $this->setDefinition($methodAwareServiceServiceId, $methodAwareDefinition); - $this->load(); + $this->loadContainer(); // Assert that method mapping have been correctly injected $this->assertContainerBuilderHasServiceDefinitionWithMethodCall( @@ -183,6 +183,6 @@ public function testShouldThowAnExceptionIfMethodAwareServiceDoesNotImplementRig JsonRpcMethodAwareInterface::class )); - $this->load(); + $this->loadContainer(); } } From be4cca8195ad81a70bffb6357c15435af556d3db Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 09:19:16 +0100 Subject: [PATCH 5/7] Fix --- .../DependencyInjection/JsonRpcMethodDefinitionHelperTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Functional/DependencyInjection/JsonRpcMethodDefinitionHelperTest.php b/tests/Functional/DependencyInjection/JsonRpcMethodDefinitionHelperTest.php index b36cdad..f9620ab 100644 --- a/tests/Functional/DependencyInjection/JsonRpcMethodDefinitionHelperTest.php +++ b/tests/Functional/DependencyInjection/JsonRpcMethodDefinitionHelperTest.php @@ -14,7 +14,7 @@ class JsonRpcMethodDefinitionHelperTest extends AbstractTestClass /** @var JsonRpcMethodDefinitionHelper */ private $helper; - public function setUp() + public function setUp(): void { $this->helper = new JsonRpcMethodDefinitionHelper(); parent::setUp(); From aa98b38112311287760379be9b9350cf28ceaf23 Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 09:23:38 +0100 Subject: [PATCH 6/7] Fix --- .../Dispatcher/SymfonyJsonRpcServerDispatcherTest.php | 2 +- tests/Functional/Endpoint/JsonRpcHttpEndpointTest.php | 2 +- tests/Functional/Event/SymfonyJsonRpcServerEventTest.php | 2 +- tests/Functional/Resolver/MethodResolverTest.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Functional/Dispatcher/SymfonyJsonRpcServerDispatcherTest.php b/tests/Functional/Dispatcher/SymfonyJsonRpcServerDispatcherTest.php index da85228..4fc8add 100644 --- a/tests/Functional/Dispatcher/SymfonyJsonRpcServerDispatcherTest.php +++ b/tests/Functional/Dispatcher/SymfonyJsonRpcServerDispatcherTest.php @@ -20,7 +20,7 @@ class SymfonyJsonRpcServerDispatcherTest extends TestCase /** @var EventDispatcherInterface|ObjectProphecy */ private $sfDispatcher; - protected function setUp() + protected function setUp(): void { $this->sfDispatcher = $this->prophesize(EventDispatcherInterface::class); $this->dispatcher = new SymfonyJsonRpcServerDispatcher( diff --git a/tests/Functional/Endpoint/JsonRpcHttpEndpointTest.php b/tests/Functional/Endpoint/JsonRpcHttpEndpointTest.php index 34f77fe..cf2d54e 100644 --- a/tests/Functional/Endpoint/JsonRpcHttpEndpointTest.php +++ b/tests/Functional/Endpoint/JsonRpcHttpEndpointTest.php @@ -19,7 +19,7 @@ class JsonRpcHttpEndpointTest extends TestCase /** @var SdkJsonRpcEndpoint|ObjectProphecy */ private $sdkEndpoint; - protected function setUp() + protected function setUp(): void { $this->sdkEndpoint = $this->prophesize(SdkJsonRpcEndpoint::class); diff --git a/tests/Functional/Event/SymfonyJsonRpcServerEventTest.php b/tests/Functional/Event/SymfonyJsonRpcServerEventTest.php index a0fa774..c858936 100644 --- a/tests/Functional/Event/SymfonyJsonRpcServerEventTest.php +++ b/tests/Functional/Event/SymfonyJsonRpcServerEventTest.php @@ -16,7 +16,7 @@ class SymfonyJsonRpcServerEventTest extends TestCase /** @var SymfonyJsonRpcServerEvent */ private $event; - protected function setUp() + protected function setUp(): void { $this->jsonRpcServerEvent = $this->prophesize(JsonRpcServerEvent::class); diff --git a/tests/Functional/Resolver/MethodResolverTest.php b/tests/Functional/Resolver/MethodResolverTest.php index eb6e868..4f16ffb 100644 --- a/tests/Functional/Resolver/MethodResolverTest.php +++ b/tests/Functional/Resolver/MethodResolverTest.php @@ -18,7 +18,7 @@ class MethodResolverTest extends TestCase /** @var ContainerInterface|ObjectProphecy */ private $locator; - protected function setUp() + protected function setUp(): void { $this->locator = $this->prophesize(ContainerInterface::class); From 0ba689da4ce85e51490154749752a0293aa43e60 Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 09:38:37 +0100 Subject: [PATCH 7/7] Fix SF3 builds --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4ec5931..2a572a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ before_install: - phpenv config-rm xdebug.ini || true install: - - composer require symfony/http-foundation:$SYMFONY_VERSION symfony/http-kernel:$SYMFONY_VERSION symfony/config:$SYMFONY_VERSION symfony/dependency-injection:$SYMFONY_VERSION + - composer require symfony/http-foundation:$SYMFONY_VERSION symfony/http-kernel:$SYMFONY_VERSION symfony/config:$SYMFONY_VERSION symfony/dependency-injection:$SYMFONY_VERSION symfony/routing:$SYMFONY_VERSION - make build script: - make test-technical