From c3d733a9345de551ab772bc486ef9e039692a43e Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 12:06:43 +0100 Subject: [PATCH 1/7] Test PHP 7.4 on Travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b26b314..554f512 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ php: - '7.1' - '7.2' - '7.3' + - '7.3' env: global: From 579501b4f3f41b9ad7ed371e42641932d61dc3b6 Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 12:06:52 +0100 Subject: [PATCH 2/7] Fix UT --- composer.json | 2 +- tests/Functional/Creator/HttpServerDocCreatorTest.php | 2 +- tests/Functional/Endpoint/DocumentationEndpointTest.php | 2 +- tests/Functional/Event/MethodDocCreatedEventTest.php | 2 +- tests/Functional/Event/ServerDocCreatedEventTest.php | 2 +- tests/Functional/Finder/NormalizedDocFinderTest.php | 2 +- tests/Functional/Listener/ServerDocCreatedListenerTest.php | 2 +- tests/Functional/Provider/RawDocProviderTest.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index a12b6a4..9f972f0 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,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", "yoanm/php-unit-extended": "~1.0" diff --git a/tests/Functional/Creator/HttpServerDocCreatorTest.php b/tests/Functional/Creator/HttpServerDocCreatorTest.php index 8eff980..665eedc 100644 --- a/tests/Functional/Creator/HttpServerDocCreatorTest.php +++ b/tests/Functional/Creator/HttpServerDocCreatorTest.php @@ -24,7 +24,7 @@ class HttpServerDocCreatorTest extends TestCase /** @var string|null */ private $jsonRpcEndpoint = 'my-endpoint'; - protected function setUp() + protected function setUp(): void { $this->dispatcher = $this->prophesize(EventDispatcherInterface::class); diff --git a/tests/Functional/Endpoint/DocumentationEndpointTest.php b/tests/Functional/Endpoint/DocumentationEndpointTest.php index e1aa3a1..cb93885 100644 --- a/tests/Functional/Endpoint/DocumentationEndpointTest.php +++ b/tests/Functional/Endpoint/DocumentationEndpointTest.php @@ -20,7 +20,7 @@ class DocumentationEndpointTest extends TestCase /** @var NormalizedDocFinder|ObjectProphecy */ private $normalizedDocFinder; - protected function setUp() + protected function setUp(): void { $this->normalizedDocFinder = $this->prophesize(NormalizedDocFinder::class); diff --git a/tests/Functional/Event/MethodDocCreatedEventTest.php b/tests/Functional/Event/MethodDocCreatedEventTest.php index 91d540f..35a0d7c 100644 --- a/tests/Functional/Event/MethodDocCreatedEventTest.php +++ b/tests/Functional/Event/MethodDocCreatedEventTest.php @@ -20,7 +20,7 @@ class MethodDocCreatedEventTest extends TestCase /** @var JsonRpcMethodInterface|ObjectProphecy|null */ private $method; - protected function setUp() + protected function setUp(): void { $this->doc = $this->prophesize(MethodDoc::class); $this->method = $this->prophesize(JsonRpcMethodInterface::class); diff --git a/tests/Functional/Event/ServerDocCreatedEventTest.php b/tests/Functional/Event/ServerDocCreatedEventTest.php index 9b644fa..f4c42a2 100644 --- a/tests/Functional/Event/ServerDocCreatedEventTest.php +++ b/tests/Functional/Event/ServerDocCreatedEventTest.php @@ -17,7 +17,7 @@ class ServerDocCreatedEventTest extends TestCase /** @var ServerDoc|ObjectProphecy */ private $doc; - protected function setUp() + protected function setUp(): void { $this->doc = $this->prophesize(ServerDoc::class); diff --git a/tests/Functional/Finder/NormalizedDocFinderTest.php b/tests/Functional/Finder/NormalizedDocFinderTest.php index 49014b8..6d1cb42 100644 --- a/tests/Functional/Finder/NormalizedDocFinderTest.php +++ b/tests/Functional/Finder/NormalizedDocFinderTest.php @@ -14,7 +14,7 @@ class NormalizedDocFinderTest extends TestCase /** @var NormalizedDocFinder */ private $finder; - protected function setUp() + protected function setUp(): void { $this->finder = new NormalizedDocFinder(); } diff --git a/tests/Functional/Listener/ServerDocCreatedListenerTest.php b/tests/Functional/Listener/ServerDocCreatedListenerTest.php index d42f082..2e2f717 100644 --- a/tests/Functional/Listener/ServerDocCreatedListenerTest.php +++ b/tests/Functional/Listener/ServerDocCreatedListenerTest.php @@ -23,7 +23,7 @@ class ServerDocCreatedListenerTest extends TestCase /** @var ServerDocCreatedListener */ private $listener; - protected function setUp() + protected function setUp(): void { $this->listener = new ServerDocCreatedListener(); } diff --git a/tests/Functional/Provider/RawDocProviderTest.php b/tests/Functional/Provider/RawDocProviderTest.php index 3b7bc24..85deea2 100644 --- a/tests/Functional/Provider/RawDocProviderTest.php +++ b/tests/Functional/Provider/RawDocProviderTest.php @@ -21,7 +21,7 @@ class RawDocProviderTest extends TestCase /** @var HttpServerDocNormalizer|ObjectProphecy */ private $serverDocNormalizer; - protected function setUp() + protected function setUp(): void { $this->httpServerDocCreator = $this->prophesize(HttpServerDocCreator::class); $this->serverDocNormalizer = $this->prophesize(HttpServerDocNormalizer::class); From 60a213b70e11714f762c5de0d24048a031b146e8 Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 12:13:58 +0100 Subject: [PATCH 3/7] Fix --- tests/Common/DependencyInjection/AbstractTestClass.php | 4 ++-- tests/Functional/DependencyInjection/ConfigFilesTest.php | 2 +- .../DependencyInjection/JsonRpcHttpServerDocExtensionTest.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Common/DependencyInjection/AbstractTestClass.php b/tests/Common/DependencyInjection/AbstractTestClass.php index 3bcf558..17b5866 100644 --- a/tests/Common/DependencyInjection/AbstractTestClass.php +++ b/tests/Common/DependencyInjection/AbstractTestClass.php @@ -23,14 +23,14 @@ abstract class AbstractTestClass extends AbstractExtensionTestCase /** * {@inheritdoc} */ - protected function getContainerExtensions() + protected function getContainerExtensions(): void { return [ new JsonRpcHttpServerDocExtension() ]; } - protected function load(array $configurationValues = [], $mockResolver = true, $compile = true) + protected function loadContainer(array $configurationValues = [], $mockResolver = true, $compile = true) { // 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 95483bd..adcd1a2 100644 --- a/tests/Functional/DependencyInjection/ConfigFilesTest.php +++ b/tests/Functional/DependencyInjection/ConfigFilesTest.php @@ -45,7 +45,7 @@ public function testHttpServerDocCreatorShouldHaveMethodsMappingAwareTag() { $serviceId = 'json_rpc_http_server_doc.creator.http_server'; - $this->load(); + $this->loadContainer(); // From yoanm/symfony-jsonrpc-http-server $this->assertContainerBuilderHasServiceDefinitionWithTag( diff --git a/tests/Functional/DependencyInjection/JsonRpcHttpServerDocExtensionTest.php b/tests/Functional/DependencyInjection/JsonRpcHttpServerDocExtensionTest.php index c25d1d6..d9c3920 100644 --- a/tests/Functional/DependencyInjection/JsonRpcHttpServerDocExtensionTest.php +++ b/tests/Functional/DependencyInjection/JsonRpcHttpServerDocExtensionTest.php @@ -14,7 +14,7 @@ class JsonRpcHttpServerDocExtensionTest extends AbstractTestClass { public function testShouldBeLoadable() { - $this->load(); + $this->loadContainer(); $this->assertEndpointIsUsable(); } @@ -43,7 +43,7 @@ public function testShouldBindDocProviderToNormalizedDocFinder() $this->setDefinition($docProviderServiceId, $docProviderServiceDefinition); - $this->load(); + $this->loadContainer(); // Assert custom resolver is an alias of the stub $this->assertContainerBuilderHasServiceDefinitionWithMethodCall( From 2057da2d18b2c3590ab7379bf5f7ca6eb274851a Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 12:17:16 +0100 Subject: [PATCH 4/7] Oups --- 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 17b5866..4fbe32c 100644 --- a/tests/Common/DependencyInjection/AbstractTestClass.php +++ b/tests/Common/DependencyInjection/AbstractTestClass.php @@ -23,7 +23,7 @@ abstract class AbstractTestClass extends AbstractExtensionTestCase /** * {@inheritdoc} */ - protected function getContainerExtensions(): void + protected function getContainerExtensions(): array { return [ new JsonRpcHttpServerDocExtension() From 8f36cb05a53eeb43e09f3f178288519960e9ebb0 Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 12:18:48 +0100 Subject: [PATCH 5/7] Roohh --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 554f512..6c4cb59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ php: - '7.1' - '7.2' - '7.3' - - '7.3' + - '7.4' env: global: From 641896cfb7fea1fc19350a15406daebc503e212a Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 12:29:30 +0100 Subject: [PATCH 6/7] Fix --- tests/Functional/DependencyInjection/ConfigFilesTest.php | 2 +- .../DependencyInjection/JsonRpcHttpServerDocExtensionTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Functional/DependencyInjection/ConfigFilesTest.php b/tests/Functional/DependencyInjection/ConfigFilesTest.php index adcd1a2..b8eb340 100644 --- a/tests/Functional/DependencyInjection/ConfigFilesTest.php +++ b/tests/Functional/DependencyInjection/ConfigFilesTest.php @@ -32,7 +32,7 @@ class ConfigFilesTest extends AbstractTestClass */ public function testShouldHaveService($serviceId, $expectedClassName, $public) { - $this->load(['endpoint' => '/endpoint'], true, false); + $this->loadContainer(['endpoint' => '/endpoint'], true, false); $this->assertContainerBuilderHasService($serviceId, $expectedClassName); if (true === $public) { diff --git a/tests/Functional/DependencyInjection/JsonRpcHttpServerDocExtensionTest.php b/tests/Functional/DependencyInjection/JsonRpcHttpServerDocExtensionTest.php index d9c3920..5aef988 100644 --- a/tests/Functional/DependencyInjection/JsonRpcHttpServerDocExtensionTest.php +++ b/tests/Functional/DependencyInjection/JsonRpcHttpServerDocExtensionTest.php @@ -22,7 +22,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); From 189720ca8fcebbb028395d48add10660b790baec Mon Sep 17 00:00:00 2001 From: Yoanm Date: Sun, 12 Jan 2020 12:34:10 +0100 Subject: [PATCH 7/7] Fix sf routing version --- .travis.yml | 2 +- composer.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6c4cb59..f244920 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ before_install: - phpenv config-rm xdebug.ini || true install: - - composer require symfony/http-kernel:$SYMFONY_VERSION symfony/config:$SYMFONY_VERSION symfony/dependency-injection:$SYMFONY_VERSION + - composer require symfony/http-kernel:$SYMFONY_VERSION symfony/config:$SYMFONY_VERSION symfony/dependency-injection:$SYMFONY_VERSION symfony/routing:$SYMFONY_VERSION - make build script: - make test-technical diff --git a/composer.json b/composer.json index 9f972f0..19e5fd9 100644 --- a/composer.json +++ b/composer.json @@ -47,6 +47,7 @@ "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/routing": "^3.0 || ^4.0", "yoanm/php-unit-extended": "~1.0" } }