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
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"minimum-stability": "stable",
"require": {
"php": "^8.3",
"doctrine/orm": "^2.7.4",
"hostnet/entity-tracker-component": "^3.0.0"
"doctrine/orm": "^2.7.4||^3.0",
"hostnet/entity-tracker-component": "^3.1.0"
},
"require-dev": {
"doctrine/dbal": "^3.6||^4.0",
"hostnet/database-test-lib": "^2.0.2",
"hostnet/phpcs-tool": "^9.1.0",
"phpunit/phpunit": "^9.5.6",
Expand Down
15 changes: 8 additions & 7 deletions test/Functional/DiscriminatorMapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
namespace Hostnet\Component\EntityMutation\Functional;

use Doctrine\Common\EventManager;
use Doctrine\DBAL\Configuration as DbalConfiguration;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Driver\AttributeDriver;
use Doctrine\ORM\ORMSetup;
use Doctrine\ORM\Tools\SchemaTool;
use Functional\Entity\Contract;
Expand Down Expand Up @@ -49,12 +51,11 @@ public static function setUpBeforeClass(): void
$params = self::$connection->getConnectionParams();
$event_manager = new EventManager();

$configuration = ORMSetup::createAttributeMetadataConfiguration(
paths: [__DIR__ . '/Entity'],
isDevMode: true,
reportFieldsWhereDeclared: true,
);
$configuration->setSchemaManagerFactory(new DefaultSchemaManagerFactory());
$configuration = ORMSetup::createConfiguration(true);
$configuration->setMetadataDriverImpl(new AttributeDriver([__DIR__ . '/Entity'], true));

$dbal_configuration = new DbalConfiguration();
$dbal_configuration->setSchemaManagerFactory(new DefaultSchemaManagerFactory());

$entity_metadat_provider = new EntityMetadataProvider();
$mutation_metadata_provider = new EntityMutationMetadataProvider();
Expand All @@ -70,7 +71,7 @@ public static function setUpBeforeClass(): void
$event_manager->addEventListener('preFlush', $entity_changed_listener);
$event_manager->addEventListener('entityChanged', $mutation_listener);

$dbal_connection = DriverManager::getConnection($params, $configuration, $event_manager);
$dbal_connection = DriverManager::getConnection($params, $dbal_configuration, $event_manager);

self::$entity_manager = new EntityManager($dbal_connection, $configuration, $event_manager);

Expand Down
15 changes: 8 additions & 7 deletions test/Functional/EmbeddableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
namespace Hostnet\Component\EntityMutation\Functional;

use Doctrine\Common\EventManager;
use Doctrine\DBAL\Configuration as DbalConfiguration;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\Driver\AttributeDriver;
use Doctrine\ORM\ORMSetup;
use Doctrine\ORM\Tools\SchemaTool;
use Hostnet\Component\DatabaseTest\MysqlPersistentConnection;
Expand Down Expand Up @@ -45,12 +47,11 @@ public static function setUpBeforeClass(): void
$params = self::$connection->getConnectionParams();
$event_manager = new EventManager();

$configuration = ORMSetup::createAttributeMetadataConfiguration(
paths: [__DIR__ . '/Entity'],
isDevMode: true,
reportFieldsWhereDeclared: true,
);
$configuration->setSchemaManagerFactory(new DefaultSchemaManagerFactory());
$configuration = ORMSetup::createConfiguration(true);
$configuration->setMetadataDriverImpl(new AttributeDriver([__DIR__ . '/Entity'], true));

$dbal_configuration = new DbalConfiguration();
$dbal_configuration->setSchemaManagerFactory(new DefaultSchemaManagerFactory());

$entity_metadata_provider = new EntityMetadataProvider();
$mutation_metadata_provider = new EntityMutationMetadataProvider();
Expand All @@ -66,7 +67,7 @@ public static function setUpBeforeClass(): void
$event_manager->addEventListener('preFlush', $entity_changed_listener);
$event_manager->addEventListener('entityChanged', $mutation_listener);

$dbal_connection = DriverManager::getConnection($params, $configuration, $event_manager);
$dbal_connection = DriverManager::getConnection($params, $dbal_configuration, $event_manager);

self::$entity_manager = new EntityManager($dbal_connection, $configuration, $event_manager);

Expand Down
2 changes: 1 addition & 1 deletion test/Listener/MutationListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Hostnet\Component\EntityMutation\Listener;

use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadata;
use Hostnet\Component\EntityMutation\Attributes\Mutation;
use Hostnet\Component\EntityMutation\Mocked\MockMutationEntity;
use Hostnet\Component\EntityMutation\Mocked\MockMutationEntityAttribute;
Expand Down
2 changes: 1 addition & 1 deletion test/Resolver/MutationResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Hostnet\Component\EntityMutation\Resolver;

use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadata;
use Hostnet\Component\EntityMutation\Attributes\Mutation;
use Hostnet\Component\EntityTracker\Provider\EntityMetadataProvider;
use PHPUnit\Framework\MockObject\MockObject;
Expand Down
Loading