Skip to content

Enabling Symfony test listener to see deprecations #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 8, 2020
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
4 changes: 3 additions & 1 deletion Resources/config/container/graphqlite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<service id="TheCodingMachine\GraphQLite\AggregateControllerQueryProviderFactory">
<argument type="collection">
</argument>
<argument type="service" id="service_container">
</argument>
<tag name="graphql.queryprovider_factory" />
</service>

Expand Down Expand Up @@ -103,7 +105,7 @@
</argument>
<tag name="graphql.type_mapper_factory"/>
</service>

<service id="graphqlite.phpfilescache" class="Symfony\Component\Cache\Adapter\PhpFilesAdapter">
<argument>graphqlite</argument>
</service>
Expand Down
8 changes: 7 additions & 1 deletion Tests/GraphqliteTestingKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Symfony\Component\Routing\RouteCollectionBuilder;
use TheCodingMachine\Graphqlite\Bundle\GraphqliteBundle;
use Symfony\Component\Security\Core\User\User;
Expand Down Expand Up @@ -67,6 +68,10 @@ public function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
'app' => 'cache.adapter.array',
];

$frameworkConf['router'] =[
'utf8' => true,
];

if ($this->enableSession) {
$frameworkConf['session'] =[
'enabled' => true,
Expand Down Expand Up @@ -136,7 +141,8 @@ public function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
$loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');
}

protected function configureRoutes(RouteCollectionBuilder $routes)
// Note: typing is disabled because using different classes in Symfony 4 and 5
protected function configureRoutes(/*RoutingConfigurator*/ $routes)
{
$routes->import(__DIR__.'/../Resources/config/routes.xml');
}
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"phpunit/phpunit": "^7.5.1",
"phpstan/phpstan": "^0.12.25",
"beberlei/porpaginas": "^1.2",
"php-coveralls/php-coveralls": "^2.1.0"
"php-coveralls/php-coveralls": "^2.1.0",
"symfony/phpunit-bridge": "^5.1"
},
"scripts": {
"phpstan": "phpstan analyse GraphqliteBundle.php DependencyInjection/ Controller/ Resources/ Security/ -c phpstan.neon --level=7 --no-progress"
Expand Down
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@
<log type="coverage-html" target="build/coverage"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
</phpunit>