Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ php:
- '7.1'
- '7.2'
- '7.3'
- '7.4'

env:
global:
Expand All @@ -25,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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tests/Common/DependencyInjection/AbstractTestClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ abstract class AbstractTestClass extends AbstractExtensionTestCase
/**
* {@inheritdoc}
*/
protected function getContainerExtensions()
protected function getContainerExtensions(): array
{
return [
new JsonRpcHttpServerExtension()
];
}

protected function load(array $configurationValues = [], $mockResolver = true, $compile = true)
protected function loadContainer(array $configurationValues = [], $mockResolver = true, $compile = true): void
{
// Inject event dispatcher
$this->setDefinition('event_dispatcher', new Definition(EventDispatcher::class));
Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/DependencyInjection/ConfigFilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ConfigFilesTest extends AbstractTestClass
/**
* {@inheritdoc}
*/
protected function getContainerExtensions()
protected function getContainerExtensions(): array
{
return [
new JsonRpcHttpServerExtension()
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class JsonRpcHttpServerExtensionTest extends AbstractTestClass
/**
* {@inheritdoc}
*/
protected function getContainerExtensions()
protected function getContainerExtensions(): array
{
return [
new JsonRpcHttpServerExtension()
Expand All @@ -29,15 +29,15 @@ protected function getContainerExtensions()

public function testShouldBeLoadable()
{
$this->load();
$this->loadContainer();

$this->assertEndpointIsUsable();
}

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);
Expand All @@ -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(
Expand Down Expand Up @@ -85,7 +85,7 @@ public function testShouldThrowAnExceptionIfDispatcherAwareServiceDoesNotUseRigh
.'"'.JsonRpcServerDispatcherAwareTrait::class.'"'
);

$this->load();
$this->loadContainer();
}

public function testShouldInjectParamsValidatorAliasIfDefined()
Expand All @@ -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,
Expand All @@ -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) {
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -183,6 +183,6 @@ public function testShouldThowAnExceptionIfMethodAwareServiceDoesNotImplementRig
JsonRpcMethodAwareInterface::class
));

$this->load();
$this->loadContainer();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Endpoint/JsonRpcHttpEndpointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Event/SymfonyJsonRpcServerEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Resolver/MethodResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down