Skip to content

Commit

Permalink
Do not longer use EntityManager::create() in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 7, 2024
1 parent 1860a9c commit 078217e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
7 changes: 4 additions & 3 deletions tests/DoctrineIntegration/ORM/entity-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Cache\Adapter\PHPArray\ArrayCachePool;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\DBAL\DriverManager;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
Expand All @@ -18,10 +19,10 @@
)
);

return EntityManager::create(
[
return new EntityManager(
DriverManager::getConnection([
'driver' => 'pdo_sqlite',
'memory' => true,
],
]),
$config
);
7 changes: 4 additions & 3 deletions tests/Rules/DeadCode/entity-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Cache\Adapter\PHPArray\ArrayCachePool;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\DBAL\DriverManager;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
Expand All @@ -27,10 +28,10 @@

$config->setMetadataDriverImpl($metadataDriver);

return EntityManager::create(
[
return new EntityManager(
DriverManager::getConnection([
'driver' => 'pdo_sqlite',
'memory' => true,
],
]),
$config
);
7 changes: 4 additions & 3 deletions tests/Rules/Doctrine/ORM/entity-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Cache\Adapter\PHPArray\ArrayCachePool;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Types\DateTimeImmutableType;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\Configuration;
Expand Down Expand Up @@ -35,10 +36,10 @@
DateTimeImmutableType::class
);

return EntityManager::create(
[
return new EntityManager(
DriverManager::getConnection([
'driver' => 'pdo_sqlite',
'memory' => true,
],
]),
$config
);
7 changes: 4 additions & 3 deletions tests/Rules/Properties/entity-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Cache\Adapter\PHPArray\ArrayCachePool;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\DBAL\DriverManager;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
Expand All @@ -28,10 +29,10 @@

$config->setMetadataDriverImpl($metadataDriver);

return EntityManager::create(
[
return new EntityManager(
DriverManager::getConnection([
'driver' => 'pdo_sqlite',
'memory' => true,
],
]),
$config
);
7 changes: 4 additions & 3 deletions tests/Type/Doctrine/data/QueryResult/entity-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Cache\Adapter\PHPArray\ArrayCachePool;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\DBAL\DriverManager;
use Doctrine\ORM\Configuration;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Column;
Expand Down Expand Up @@ -30,10 +31,10 @@

$config->setMetadataDriverImpl($metadataDriver);

return EntityManager::create(
[
return new EntityManager(
DriverManager::getConnection([
'driver' => 'pdo_sqlite',
'memory' => true,
],
]),
$config
);

0 comments on commit 078217e

Please sign in to comment.