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
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- { php-version: 8.3, symfony-version: 6.4.*, orm-version: '^3.0', dependency-version: '' }
- { php-version: 8.4, symfony-version: 7.*, orm-version: '^2.20', dependency-version: '' }
- { php-version: 8.4, symfony-version: 7.*, orm-version: '^3.0', dependency-version: '' }
- { php-version: 8.4, symfony-version: 8.*, orm-version: '^3.0', dependency-version: '' }
name: PHPUnit (PHP ${{matrix.php-version}}, Symfony version constraint ${{ matrix.symfony-version || 'none' }}, Doctrine ORM version constraint ${{ matrix.orm-version || 'none' }}, ${{ matrix.dependency-version || 'prefer-stable' }})
steps:
- uses: actions/checkout@v4
Expand Down
32 changes: 16 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
"doctrine/dbal": "^3.0|^4.0",
"doctrine/orm": "^2.8|^3.0",
"doctrine/persistence": "^2.1|^3.0|^4.0",
"psr/container": "^1.0",
"psr/log": "^1|^2|^3",
"symfony/config": "^6.4|^7.0",
"psr/container": "^1.0|^2.0",
"psr/log": "^2.0|^3.0",
"symfony/config": "^6.4|^7.3|^8.0",
"symfony/service-contracts": "^2.5|^3.0",
"symfony/dependency-injection": "^6.4|^7.0",
"symfony/filesystem": "^6.4|^7.0",
"symfony/finder": "^6.4|^7.0",
"symfony/http-foundation": "^6.4|^7.0",
"symfony/http-kernel": "^6.4|^7.0",
"symfony/lock": "^6.4|^7.0",
"symfony/twig-bundle": "^6.4|^7.0",
"symfony/dependency-injection": "^6.4|^7.3|^8.0",
"symfony/filesystem": "^6.4|^7.3|^8.0",
"symfony/finder": "^6.4|^7.3|^8.0",
"symfony/http-foundation": "^6.4|^7.3|^8.0",
"symfony/http-kernel": "^6.4|^7.3|^8.0",
"symfony/lock": "^6.4|^7.3|^8.0",
"symfony/twig-bundle": "^6.4|^7.3|^8.0",
"twig/twig": "^2.0|^3.0"
},

Expand All @@ -38,12 +38,12 @@
},

"require-dev": {
"doctrine/doctrine-bundle": "^2.12",
"phpunit/phpunit": "^10.5.59",
"symfony/error-handler": "^6.4|^7.0",
"symfony/framework-bundle": "^6.4|^7.0",
"symfony/twig-bundle": "^6.4|^7.0",
"symfony/yaml": "^6.4|^7.0"
"doctrine/doctrine-bundle": "^2.12|^3.0",
"phpunit/phpunit": "^10.5.59|^11.5.45",
"symfony/error-handler": "^6.4|^7.3|^8.0",
"symfony/framework-bundle": "^6.4|^7.3|^8.0",
"symfony/twig-bundle": "^6.4|^7.3|^8.0",
"symfony/yaml": "^6.4|^7.3|^8.0"
},

"autoload": {
Expand Down
33 changes: 32 additions & 1 deletion tests/Fixtures/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Webfactory\Bundle\WfdMetaBundle\Tests\Fixtures;

use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel;

class TestKernel extends Kernel
Expand All @@ -19,7 +20,37 @@ public function registerBundles(): iterable

public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(__DIR__.'/config/config.yml');
$loader->load(static function (ContainerBuilder $container): void {
$container->loadFromExtension('framework', [
'secret' => 'dont-tell-mum',
'test' => true,
'http_method_override' => false,
'handle_all_throwables' => true,
'php_errors' => [
'log' => true,
],
] + (Kernel::VERSION_ID < 70000 ? ['annotations' => false] : []));

$container->loadFromExtension('doctrine', [
'dbal' => [
'driver' => 'pdo_sqlite',
'memory' => true,
],
'orm' => [
'controller_resolver' => [
'auto_mapping' => false,
],
'mappings' => [
'Webfactory\Bundle\WfdMetaBundle\Tests\Fixtures\Entity' => [
'type' => 'attribute',
'dir' => '%kernel.project_dir%/Entity',
'is_bundle' => false,
'prefix' => 'Webfactory\Bundle\WfdMetaBundle\Tests\Fixtures\Entity',
],
],
],
]);
});
}

public function getProjectDir(): string
Expand Down
22 changes: 0 additions & 22 deletions tests/Fixtures/config/config.yml

This file was deleted.

8 changes: 7 additions & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<?php

use Symfony\Component\ErrorHandler\DebugClassLoader;
use Symfony\Component\ErrorHandler\ErrorHandler;

require_once __DIR__.'/../vendor/autoload.php';

// ensure a fresh cache every time tests are run
// Work around https://github.com/symfony/symfony/issues/53812 for the time being (issue starting with Symfony 6.4 or 7.1 and PHPUnit 11 or 12?)
set_exception_handler([new ErrorHandler(), 'handleException']);

// Ensure a fresh cache every time tests are run,
// even with debug mode disabled (https://symfony.com/doc/current/testing.html#set-up-your-test-environment)
(new Symfony\Component\Filesystem\Filesystem())->remove(__DIR__.'/Fixtures/var/cache/test');

// Use DebugClassLoader to catch certain deprecations that can only be found through source code analysis
DebugClassLoader::enable();