diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01a85ac..43138c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,14 +12,15 @@ env: jobs: build: runs-on: ${{ matrix.os }} - name: PHP v${{ matrix.php }} with Mongo v${{ matrix.mongodb }} + name: PHP v${{ matrix.php }}, Symfony v${{ matrix.symfony }} with Mongo v${{ matrix.mongodb }} strategy: matrix: include: - { os: ubuntu-latest, php: 7.3, mongodb: 3.6, symfony: "4.4.*"} - { os: ubuntu-latest, php: 7.3, mongodb: 3.6, symfony: "5.1.*"} - { os: ubuntu-latest, php: 7.4, mongodb: 3.6, symfony: "5.2.*"} - - { os: ubuntu-latest, php: 8.0, mongodb: 3.6, symfony: "5.x-dev"} + - { os: ubuntu-latest, php: 7.4, mongodb: 3.6, symfony: "5.3.*"} + - { os: ubuntu-latest, php: 8.0, mongodb: 3.6, symfony: "5.4.*@dev"} services: mongo: image: mongo:${{ matrix.mongodb }} @@ -43,6 +44,9 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Install Symfony ${{ matrix.symfony }} run: composer require symfony/symfony:${{ matrix.symfony }} --no-update + - name: "Require symfony/messenger" + run: "composer require --dev symfony/doctrine-messenger --no-update" + if: "${{ startsWith(matrix.symfony, '5.3') || startsWith(matrix.symfony, '5.4') }}" - name: Cache Composer dependencies uses: actions/cache@v2 with: diff --git a/Tests/TestCase.php b/Tests/TestCase.php index b05c224..142d013 100644 --- a/Tests/TestCase.php +++ b/Tests/TestCase.php @@ -4,10 +4,8 @@ use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension; use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; -use Doctrine\Bundle\MongoDBBundle\DependencyInjection\DoctrineMongoDBExtension; -use Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle; use Doctrine\Common\Annotations\AnnotationReader; -use Doctrine\Common\Cache\ArrayCache; +use Doctrine\Common\Cache\Psr6\DoctrineProvider; use Doctrine\ODM\MongoDB\Configuration; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver; @@ -18,7 +16,7 @@ use Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle; use Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; @@ -64,13 +62,10 @@ public function getFormFactory() */ public function getSqliteEntityManager() { - $cache = new \Doctrine\Common\Cache\ArrayCache(); + $arrayAdapter = new ArrayAdapter(); + $cache = DoctrineProvider::wrap(new ArrayAdapter()); - if (class_exists('Doctrine\Common\Annotations\DocParser')) { - $reader = new AnnotationReader(new \Doctrine\Common\Annotations\DocParser()); - } else { - $reader = new AnnotationReader($cache); - } + $reader = new AnnotationReader(new \Doctrine\Common\Annotations\DocParser()); $mappingDriver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array( __DIR__.'/Fixtures/Entity', @@ -79,7 +74,7 @@ public function getSqliteEntityManager() $config = \Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration(array()); $config->setMetadataDriverImpl($mappingDriver); - $config->setMetadataCacheImpl($cache); + $config->setMetadataCache($arrayAdapter); $config->setQueryCacheImpl($cache); $config->setProxyDir(sys_get_temp_dir()); $config->setProxyNamespace('Proxy'); @@ -99,10 +94,10 @@ public function getSqliteEntityManager() public function getMongodbDocumentManager(): DocumentManager { - $cache = new ArrayCache(); + $arrayAdapter = new ArrayAdapter(); $config = new Configuration(); - $config->setMetadataCacheImpl($cache); + $config->setMetadataCache($arrayAdapter); $config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader(), [__DIR__.'/Fixtures/Document/'])); $config->setAutoGenerateProxyClasses(Configuration::AUTOGENERATE_FILE_NOT_EXISTS); @@ -138,7 +133,7 @@ private static function createContainerBuilder(array $configs = []) 'kernel.bundles' => [ 'FrameworkBundle' => FrameworkBundle::class, 'DoctrineBundle' => DoctrineBundle::class, - 'LexikJWTAuthenticationBundle' => LexikFormFilterBundle::class + 'LexikFormFilterBundle' => LexikFormFilterBundle::class ], 'kernel.bundles_metadata' => [], 'kernel.cache_dir' => __DIR__,