diff --git a/tests/Gedmo/Mapping/LoggableORMMappingTest.php b/tests/Gedmo/Mapping/LoggableORMMappingTest.php index 07fd5bf87..f2d07801e 100644 --- a/tests/Gedmo/Mapping/LoggableORMMappingTest.php +++ b/tests/Gedmo/Mapping/LoggableORMMappingTest.php @@ -59,9 +59,7 @@ public static function dataLoggableObject(): \Generator { if (PHP_VERSION_ID >= 80000) { yield 'Model with attributes' => [AnnotatedLoggable::class]; - } - - if (class_exists(AnnotationDriver::class)) { + } elseif (class_exists(AnnotationDriver::class)) { yield 'Model with annotations' => [AnnotatedLoggable::class]; } @@ -121,9 +119,7 @@ public static function dataLoggableObjectWithCompositeKey(): \Generator if (PHP_VERSION_ID >= 80000) { yield 'Model with attributes' => [AnnotatedLoggableComposite::class]; - } - - if (class_exists(AnnotationDriver::class)) { + } elseif (class_exists(AnnotationDriver::class)) { yield 'Model with annotations' => [AnnotatedLoggableComposite::class]; } @@ -166,9 +162,7 @@ public static function dataLoggableObjectWithCompositeKeyAndRelation(): \Generat if (PHP_VERSION_ID >= 80000) { yield 'Model with attributes' => [AnnotatedLoggableCompositeRelation::class]; - } - - if (class_exists(AnnotationDriver::class)) { + } elseif (class_exists(AnnotationDriver::class)) { yield 'Model with annotations' => [AnnotatedLoggableCompositeRelation::class]; } @@ -214,9 +208,7 @@ public static function dataLoggableObjectWithEmbedded(): \Generator { if (PHP_VERSION_ID >= 80000) { yield 'Model with attributes' => [AnnotatedLoggableWithEmbedded::class]; - } - - if (class_exists(AnnotationDriver::class)) { + } elseif (class_exists(AnnotationDriver::class)) { yield 'Model with annotations' => [AnnotatedLoggableWithEmbedded::class]; } } diff --git a/tests/Gedmo/Mapping/ORMMappingTestCase.php b/tests/Gedmo/Mapping/ORMMappingTestCase.php index 021b6b3f2..cbccbd389 100644 --- a/tests/Gedmo/Mapping/ORMMappingTestCase.php +++ b/tests/Gedmo/Mapping/ORMMappingTestCase.php @@ -76,9 +76,7 @@ final protected function createChainedMappingDriver(): MappingDriverChain if (PHP_VERSION_ID >= 80000) { $chain->addDriver(new AttributeDriver([]), 'Gedmo\Tests\Mapping\Fixture'); - } - - if (class_exists(AnnotationDriver::class) && class_exists(AnnotationReader::class)) { + } elseif (class_exists(AnnotationDriver::class) && class_exists(AnnotationReader::class)) { $chain->addDriver(new AnnotationDriver(new AnnotationReader()), 'Gedmo\Tests\Mapping\Fixture'); } diff --git a/tests/Gedmo/Mapping/SluggableMappingTest.php b/tests/Gedmo/Mapping/SluggableMappingTest.php index 12ea9576f..9b9ad8cce 100644 --- a/tests/Gedmo/Mapping/SluggableMappingTest.php +++ b/tests/Gedmo/Mapping/SluggableMappingTest.php @@ -51,9 +51,7 @@ public static function dataSluggableObject(): \Generator if (PHP_VERSION_ID >= 80000) { yield 'Model with attributes' => [AnnotatedSluggable::class]; - } - - if (class_exists(AnnotationDriver::class)) { + } elseif (class_exists(AnnotationDriver::class)) { yield 'Model with annotations' => [AnnotatedSluggable::class]; } } diff --git a/tests/Gedmo/Mapping/SoftDeleteableMappingTest.php b/tests/Gedmo/Mapping/SoftDeleteableMappingTest.php index 914e1528c..0b868de5c 100644 --- a/tests/Gedmo/Mapping/SoftDeleteableMappingTest.php +++ b/tests/Gedmo/Mapping/SoftDeleteableMappingTest.php @@ -50,9 +50,7 @@ public static function dataSoftDeleteableObject(): \Generator if (PHP_VERSION_ID >= 80000) { yield 'Model with attributes' => [AnnotatedSoftDeleteable::class]; - } - - if (class_exists(AnnotationDriver::class)) { + } elseif (class_exists(AnnotationDriver::class)) { yield 'Model with annotations' => [AnnotatedSoftDeleteable::class]; } diff --git a/tests/Gedmo/Mapping/SortableMappingTest.php b/tests/Gedmo/Mapping/SortableMappingTest.php index 63a77c792..f95c8150f 100644 --- a/tests/Gedmo/Mapping/SortableMappingTest.php +++ b/tests/Gedmo/Mapping/SortableMappingTest.php @@ -49,9 +49,7 @@ public static function dataSortableObject(): \Generator if (PHP_VERSION_ID >= 80000) { yield 'Model with attributes' => [AnnotatedSortable::class]; - } - - if (class_exists(AnnotationDriver::class)) { + } elseif (class_exists(AnnotationDriver::class)) { yield 'Model with annotations' => [AnnotatedSortable::class]; } diff --git a/tests/Gedmo/Mapping/TimestampableMappingTest.php b/tests/Gedmo/Mapping/TimestampableMappingTest.php index 2922652f3..91c3ec1d8 100644 --- a/tests/Gedmo/Mapping/TimestampableMappingTest.php +++ b/tests/Gedmo/Mapping/TimestampableMappingTest.php @@ -49,9 +49,7 @@ public static function dataTimestampableObject(): \Generator { if (PHP_VERSION_ID >= 80000) { yield 'Model with attributes' => [AnnotatedCategory::class]; - } - - if (class_exists(AnnotationDriver::class)) { + } elseif (class_exists(AnnotationDriver::class)) { yield 'Model with annotations' => [AnnotatedCategory::class]; } diff --git a/tests/Gedmo/Mapping/TranslatableMappingTest.php b/tests/Gedmo/Mapping/TranslatableMappingTest.php index f63ed3cc8..4edec0a40 100644 --- a/tests/Gedmo/Mapping/TranslatableMappingTest.php +++ b/tests/Gedmo/Mapping/TranslatableMappingTest.php @@ -51,9 +51,7 @@ public static function dataSortableObject(): \Generator if (PHP_VERSION_ID >= 80000) { yield 'Model with attributes' => [AnnotatedUser::class]; - } - - if (class_exists(AnnotationDriver::class)) { + } elseif (class_exists(AnnotationDriver::class)) { yield 'Model with annotations' => [AnnotatedUser::class]; } diff --git a/tests/Gedmo/Mapping/UploadableMappingTest.php b/tests/Gedmo/Mapping/UploadableMappingTest.php index fb60c483d..e76d13a6f 100644 --- a/tests/Gedmo/Mapping/UploadableMappingTest.php +++ b/tests/Gedmo/Mapping/UploadableMappingTest.php @@ -54,9 +54,7 @@ public static function dataUploadableObject(): \Generator if (PHP_VERSION_ID >= 80000) { yield 'Model with attributes' => [AnnotatedUploadable::class]; - } - - if (class_exists(AnnotationDriver::class)) { + } elseif (class_exists(AnnotationDriver::class)) { yield 'Model with annotations' => [AnnotatedUploadable::class]; } diff --git a/tests/Gedmo/Timestampable/AttributeChangeTest.php b/tests/Gedmo/Timestampable/AttributeChangeTest.php index c2c260d61..261a2038d 100644 --- a/tests/Gedmo/Timestampable/AttributeChangeTest.php +++ b/tests/Gedmo/Timestampable/AttributeChangeTest.php @@ -25,6 +25,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) * * @requires PHP >= 8.0 + * + * @todo This test requires {@see ChangeTest} to have been run first to load the {@see TimestampableListenerStub} */ final class AttributeChangeTest extends BaseTestCaseORM {