diff --git a/.travis.yml b/.travis.yml index b26b314..f244920 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ php: - '7.1' - '7.2' - '7.3' + - '7.4' env: global: @@ -25,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 a12b6a4..19e5fd9 100644 --- a/composer.json +++ b/composer.json @@ -44,9 +44,10 @@ "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/routing": "^3.0 || ^4.0", "yoanm/php-unit-extended": "~1.0" } } diff --git a/tests/Common/DependencyInjection/AbstractTestClass.php b/tests/Common/DependencyInjection/AbstractTestClass.php index 3bcf558..4fbe32c 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(): array { 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/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/DependencyInjection/ConfigFilesTest.php b/tests/Functional/DependencyInjection/ConfigFilesTest.php index 95483bd..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) { @@ -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..5aef988 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(); } @@ -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); @@ -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( 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);