Skip to content

Commit

Permalink
FIX tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerdweight committed Dec 8, 2020
1 parent 26b7b4e commit 074fdce
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 31 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- '7.2'
- '7.3'
- '7.4'

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"require": {
"php": ">=7.2.0",
"php": ">=7.3.0",
"symfony/framework-bundle": "^4.0|^5.0",
"thecodingmachine/safe": "^1.0",
"wernerdweight/ra": "^1.0"
Expand Down
50 changes: 24 additions & 26 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/7.2/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<server name="KERNEL_CLASS" value="WernerDweight\CORSBundle\Tests\TestKernel"/>
<ini name="error_reporting" value="-1" />
</php>

<testsuites>
<testsuite name="CORS Bundle Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./</directory>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>
<coverage>
<include>
<directory>./</directory>
</include>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</coverage>
<php>
<server name="KERNEL_CLASS" value="WernerDweight\CORSBundle\Tests\TestKernel"/>
<ini name="error_reporting" value="-1"/>
</php>
<testsuites>
<testsuite name="CORS Bundle Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
</phpunit>
30 changes: 30 additions & 0 deletions phpunit.xml.dist.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/7.2/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<server name="KERNEL_CLASS" value="WernerDweight\CORSBundle\Tests\TestKernel"/>
<ini name="error_reporting" value="-1" />
</php>

<testsuites>
<testsuite name="CORS Bundle Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./</directory>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
9 changes: 6 additions & 3 deletions tests/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use WernerDweight\CORSBundle\CORSBundle;
use WernerDweight\CORSBundle\Tests\Helpers\TestTargetedControllerInterface;

Expand All @@ -28,19 +28,22 @@ public function registerBundles(): array
];
}

protected function configureRoutes(RouteCollectionBuilder $routes): void
protected function configureRoutes(RoutingConfigurator $routes): void
{
$routes->import(__DIR__ . '/Resources/config/routes.yaml');
}

protected function configureContainer(ContainerBuilder $builder, LoaderInterface $loader): void
{
$loader->load(__DIR__ . '/../vendor/symfony/framework-bundle/Resources/config/test.xml');
$loader->load(__DIR__ . '/../vendor/symfony/framework-bundle/Resources/config/test.php');
$loader->load(__DIR__ . '/../src/Resources/config/services.yaml');

$builder->loadFromExtension('framework', [
'secret' => 'not-so-secret',
'test' => true,
'router' => [
'utf8' => true,
],
]);
$builder->loadFromExtension('cors', [
'access_control' => [
Expand Down

0 comments on commit 074fdce

Please sign in to comment.