-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
BugA confirmed bug in Extensions that needs fixing.A confirmed bug in Extensions that needs fixing.
Description
With this patch to force the ORM's 3.4 dev branch to be installed and to enable the new native lazy ghosts functionality:
diff --git a/composer.json b/composer.json
index eabf6490..b2d2e717 100644
--- a/composer.json
+++ b/composer.json
@@ -57,7 +57,7 @@
"doctrine/dbal": "^3.7 || ^4.0",
"doctrine/doctrine-bundle": "^2.3",
"doctrine/mongodb-odm": "^2.3",
- "doctrine/orm": "^2.20 || ^3.3",
+ "doctrine/orm": "^3.4@dev",
"friendsofphp/php-cs-fixer": "^3.70",
"nesbot/carbon": "^2.71 || ^3.0",
"phpstan/phpstan": "^2.1.1",
diff --git a/tests/Gedmo/Mapping/MappingTest.php b/tests/Gedmo/Mapping/MappingTest.php
index 15623a8f..8fa63145 100644
--- a/tests/Gedmo/Mapping/MappingTest.php
+++ b/tests/Gedmo/Mapping/MappingTest.php
@@ -49,6 +49,10 @@ final class MappingTest extends TestCase
$config->setMetadataDriverImpl(new AnnotationDriver($_ENV['annotation_reader']));
}
+ if (PHP_VERSION_ID >= 80400 && method_exists($config, 'enableNativeLazyObjects')) {
+ $config->enableNativeLazyObjects(true);
+ }
+
$conn = [
'driver' => 'pdo_sqlite',
'memory' => true,
diff --git a/tests/Gedmo/Mapping/MetadataFactory/CustomDriverTest.php b/tests/Gedmo/Mapping/MetadataFactory/CustomDriverTest.php
index 024101d1..841e2710 100644
--- a/tests/Gedmo/Mapping/MetadataFactory/CustomDriverTest.php
+++ b/tests/Gedmo/Mapping/MetadataFactory/CustomDriverTest.php
@@ -43,6 +43,10 @@ final class CustomDriverTest extends TestCase
$config->setProxyNamespace('Gedmo\Mapping\Proxy');
$config->setMetadataDriverImpl(new CustomDriver());
+ if (PHP_VERSION_ID >= 80400 && method_exists($config, 'enableNativeLazyObjects')) {
+ $config->enableNativeLazyObjects(true);
+ }
+
$conn = [
'driver' => 'pdo_sqlite',
'memory' => true,
diff --git a/tests/Gedmo/Mapping/MetadataFactory/ForcedMetadataTest.php b/tests/Gedmo/Mapping/MetadataFactory/ForcedMetadataTest.php
index ca687cdd..4fe0b116 100644
--- a/tests/Gedmo/Mapping/MetadataFactory/ForcedMetadataTest.php
+++ b/tests/Gedmo/Mapping/MetadataFactory/ForcedMetadataTest.php
@@ -50,6 +50,10 @@ final class ForcedMetadataTest extends TestCase
$config->setMetadataDriverImpl(new AnnotationDriver($_ENV['annotation_reader']));
}
+ if (PHP_VERSION_ID >= 80400 && method_exists($config, 'enableNativeLazyObjects')) {
+ $config->enableNativeLazyObjects(true);
+ }
+
$this->timestampable = new TimestampableListener();
if (PHP_VERSION_ID >= 80000) {
diff --git a/tests/Gedmo/Mapping/ORMMappingTestCase.php b/tests/Gedmo/Mapping/ORMMappingTestCase.php
index cddf2ebc..a4390bab 100644
--- a/tests/Gedmo/Mapping/ORMMappingTestCase.php
+++ b/tests/Gedmo/Mapping/ORMMappingTestCase.php
@@ -46,6 +46,10 @@ abstract class ORMMappingTestCase extends TestCase
$config->setProxyDir(TESTS_TEMP_DIR);
$config->setProxyNamespace('Gedmo\Mapping\Proxy');
+ if (PHP_VERSION_ID >= 80400 && method_exists($config, 'enableNativeLazyObjects')) {
+ $config->enableNativeLazyObjects(true);
+ }
+
return $config;
}
diff --git a/tests/Gedmo/Tool/BaseTestCaseORM.php b/tests/Gedmo/Tool/BaseTestCaseORM.php
index 3e77c9d3..4fa3393f 100644
--- a/tests/Gedmo/Tool/BaseTestCaseORM.php
+++ b/tests/Gedmo/Tool/BaseTestCaseORM.php
@@ -103,6 +103,10 @@ abstract class BaseTestCaseORM extends TestCase
new Middleware($this->queryLogger),
]);
+ if (PHP_VERSION_ID >= 80400 && method_exists($config, 'enableNativeLazyObjects')) {
+ $config->enableNativeLazyObjects(true);
+ }
+
return $config;
}
There are a handful of test failures, all of which boil down to asserting that a proxy is returned:
1) Gedmo\Tests\Translatable\Issue\Issue84Test::testIssue84
Failed asserting that Gedmo\Tests\Translatable\Fixture\Article Object (...) is an instance of interface "Doctrine\Persistence\Proxy".
/tests/Gedmo/Translatable/Issue/Issue84Test.php:54
2) Gedmo\Tests\Tree\MaterializedPathORMRepositoryTest::testIssue458
Failed asserting that Gedmo\Tests\Tree\Fixture\MPCategory Object (...) is an instance of interface "Doctrine\Persistence\Proxy".
/tests/Gedmo/Tree/MaterializedPathORMRepositoryTest.php:335
3) Gedmo\Tests\Tree\TranslatableSluggableTreeTest::testTranslations
Failed asserting that Gedmo\Tests\Tree\Fixture\BehavioralCategory Object (...) is an instance of interface "Doctrine\Persistence\Proxy".
/tests/Gedmo/Tree/TranslatableSluggableTreeTest.php:97
4) Gedmo\Tests\Timestampable\TimestampableTest::testShouldSolveIssue767
Failed asserting that Gedmo\Tests\Timestampable\Fixture\Type Object (...) is an instance of interface "Doctrine\Persistence\Proxy".
/tests/Gedmo/Timestampable/TimestampableTest.php:233
5) Gedmo\Tests\Wrapper\EntityWrapperTest::testProxy
Failed asserting that Gedmo\Tests\Wrapper\Fixture\Entity\Article Object (...) is an instance of interface "Doctrine\Persistence\Proxy".
/tests/Gedmo/Wrapper/EntityWrapperTest.php:54
6) Gedmo\Tests\Wrapper\EntityWrapperTest::testCompositeRelationProxy
Failed asserting that Gedmo\Tests\Wrapper\Fixture\Entity\CompositeRelation Object (...) is an instance of interface "Doctrine\Persistence\Proxy".
/tests/Gedmo/Wrapper/EntityWrapperTest.php:142
7) Gedmo\Tests\Translator\TranslatableTest::testShouldTranslateRelation
Failed asserting that Gedmo\Tests\Translator\Fixture\Person Object (...) is an instance of interface "Doctrine\Persistence\Proxy".
/tests/Gedmo/Translator/TranslatableTest.php:117
8) Gedmo\Tests\Translator\TranslatableTest::testShouldHandleDomainObjectProxy
Failed asserting that Gedmo\Tests\Translator\Fixture\Person Object (...) is an instance of interface "Doctrine\Persistence\Proxy".
/tests/Gedmo/Translator/TranslatableTest.php:136
9) Gedmo\Tests\Translator\TranslatableTest::testTranslatableProxyWithUpperCaseProperty
Failed asserting that Gedmo\Tests\Translator\Fixture\Person Object (...) is an instance of interface "Doctrine\Persistence\Proxy".
/tests/Gedmo/Translator/TranslatableTest.php:156
A more thorough investigation may be needed to ensure this package works well with PHP 8.4's lazy objects which won't use Doctrine's proxy interfaces. PRs like #2946 help with this.
Metadata
Metadata
Assignees
Labels
BugA confirmed bug in Extensions that needs fixing.A confirmed bug in Extensions that needs fixing.