File tree Expand file tree Collapse file tree 7 files changed +23
-2
lines changed Expand file tree Collapse file tree 7 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 55namespace Doctrine \Tests \ORM \Mapping ;
66
77use Doctrine \DBAL \Platforms \AbstractPlatform ;
8+ use Doctrine \DBAL \Schema \Name \UnquotedIdentifierFolding ;
89use Doctrine \ORM \Mapping \DefaultQuoteStrategy ;
910use Doctrine \Tests \Models \NonPublicSchemaJoins \User as NonPublicSchemaUser ;
1011use Doctrine \Tests \OrmTestCase ;
1112use PHPUnit \Framework \Attributes \Group ;
1213
1314use function assert ;
15+ use function enum_exists ;
1416
1517/**
1618 * Doctrine\Tests\ORM\Mapping\DefaultQuoteStrategyTest
@@ -24,7 +26,7 @@ public function testGetJoinTableName(): void
2426 $ em = $ this ->getTestEntityManager ();
2527 $ metadata = $ em ->getClassMetadata (NonPublicSchemaUser::class);
2628 $ strategy = new DefaultQuoteStrategy ();
27- $ platform = $ this ->getMockForAbstractClass (AbstractPlatform::class);
29+ $ platform = $ this ->getMockForAbstractClass (AbstractPlatform::class, enum_exists (UnquotedIdentifierFolding::class) ? [UnquotedIdentifierFolding:: UPPER ] : [] );
2830 assert ($ platform instanceof AbstractPlatform);
2931
3032 self ::assertSame (
Original file line number Diff line number Diff line change 99use Doctrine \DBAL \Connection ;
1010use Doctrine \DBAL \Driver ;
1111use Doctrine \DBAL \Platforms \AbstractPlatform ;
12+ use Doctrine \DBAL \Schema \Name \UnquotedIdentifierFolding ;
1213use Doctrine \DBAL \Types \Type as DBALType ;
1314use Doctrine \ORM \Mapping \OneToManyAssociationMapping ;
1415use Doctrine \ORM \Persisters \Entity \BasicEntityPersister ;
2324use ReflectionMethod ;
2425
2526use function array_slice ;
27+ use function enum_exists ;
2628
2729class BasicEntityPersisterTypeValueSqlTest extends OrmTestCase
2830{
@@ -65,6 +67,7 @@ public function testUpdateUsesTypeValuesSQL(): void
6567 ->willReturn ($ this ->createMock (Driver \Connection::class));
6668
6769 $ platform = $ this ->getMockBuilder (AbstractPlatform::class)
70+ ->setConstructorArgs (enum_exists (UnquotedIdentifierFolding::class) ? [UnquotedIdentifierFolding::UPPER ] : [])
6871 ->onlyMethods (['supportsIdentityColumns ' ])
6972 ->getMockForAbstractClass ();
7073 $ platform ->method ('supportsIdentityColumns ' )
Original file line number Diff line number Diff line change 77use Doctrine \DBAL \Connection ;
88use Doctrine \DBAL \Driver ;
99use Doctrine \DBAL \Platforms \AbstractPlatform ;
10+ use Doctrine \DBAL \Schema \Name \UnquotedIdentifierFolding ;
1011use Doctrine \ORM \Persisters \Collection \ManyToManyPersister ;
1112use Doctrine \Tests \Models \ManyToManyPersister \ChildClass ;
1213use Doctrine \Tests \Models \ManyToManyPersister \OtherParentClass ;
1516use PHPUnit \Framework \Attributes \CoversClass ;
1617use PHPUnit \Framework \Attributes \Group ;
1718
19+ use function enum_exists ;
20+
1821#[CoversClass(ManyToManyPersister::class)]
1922final class ManyToManyPersisterTest extends OrmTestCase
2023{
@@ -31,7 +34,7 @@ public function testDeleteManyToManyCollection(): void
3134 ->onlyMethods (['executeStatement ' , 'getDatabasePlatform ' ])
3235 ->getMock ();
3336 $ connection ->method ('getDatabasePlatform ' )
34- ->willReturn ($ this ->getMockForAbstractClass (AbstractPlatform::class));
37+ ->willReturn ($ this ->getMockForAbstractClass (AbstractPlatform::class, enum_exists (UnquotedIdentifierFolding::class) ? [UnquotedIdentifierFolding:: UPPER ] : [] ));
3538
3639 $ parent = new ParentClass (1 );
3740 $ otherParent = new OtherParentClass (42 );
Original file line number Diff line number Diff line change 1414use Doctrine \DBAL \LockMode ;
1515use Doctrine \DBAL \ParameterType ;
1616use Doctrine \DBAL \Platforms \AbstractPlatform ;
17+ use Doctrine \DBAL \Schema \Name \UnquotedIdentifierFolding ;
1718use Doctrine \DBAL \Types \Types ;
1819use Doctrine \ORM \EntityManagerInterface ;
1920use Doctrine \ORM \Query ;
3940use Symfony \Component \Cache \Adapter \ArrayAdapter ;
4041
4142use function array_map ;
43+ use function enum_exists ;
4244
4345class QueryTest extends OrmTestCase
4446{
@@ -597,6 +599,7 @@ private function createConnection(Result ...$results): Connection
597599 ->will ($ this ->onConsecutiveCalls (...$ results ));
598600
599601 $ platform = $ this ->getMockBuilder (AbstractPlatform::class)
602+ ->setConstructorArgs (enum_exists (UnquotedIdentifierFolding::class) ? [UnquotedIdentifierFolding::UPPER ] : [])
600603 ->onlyMethods (['supportsIdentityColumns ' ])
601604 ->getMockForAbstractClass ();
602605 $ platform ->method ('supportsIdentityColumns ' )
Original file line number Diff line number Diff line change 88use Doctrine \DBAL \Driver ;
99use Doctrine \DBAL \Platforms \AbstractPlatform ;
1010use Doctrine \DBAL \Result ;
11+ use Doctrine \DBAL \Schema \Name \UnquotedIdentifierFolding ;
1112use Doctrine \ORM \Decorator \EntityManagerDecorator ;
1213use Doctrine \ORM \EntityManagerInterface ;
1314use Doctrine \ORM \Internal \Hydration \AbstractHydrator ;
1718use Doctrine \Tests \OrmTestCase ;
1819use PHPUnit \Framework \MockObject \MockObject ;
1920
21+ use function enum_exists ;
22+
2023class PaginatorTest extends OrmTestCase
2124{
2225 private Connection &MockObject $ connection ;
@@ -26,6 +29,7 @@ class PaginatorTest extends OrmTestCase
2629 protected function setUp (): void
2730 {
2831 $ platform = $ this ->getMockBuilder (AbstractPlatform::class)
32+ ->setConstructorArgs (enum_exists (UnquotedIdentifierFolding::class) ? [UnquotedIdentifierFolding::UPPER ] : [])
2933 ->onlyMethods (['supportsIdentityColumns ' ])
3034 ->getMockForAbstractClass ();
3135 $ platform ->method ('supportsIdentityColumns ' )
Original file line number Diff line number Diff line change 1111use Doctrine \DBAL \Driver \Statement ;
1212use Doctrine \DBAL \Exception ;
1313use Doctrine \DBAL \Platforms \AbstractPlatform ;
14+ use Doctrine \DBAL \Schema \Name \UnquotedIdentifierFolding ;
1415use Doctrine \ORM \EntityNotFoundException ;
1516use Doctrine \ORM \Exception \EntityIdentityCollisionException ;
1617use Doctrine \ORM \Mapping \ClassMetadata ;
3839use PHPUnit \Framework \MockObject \MockObject ;
3940use stdClass ;
4041
42+ use function enum_exists ;
4143use function random_int ;
4244use function uniqid ;
4345
@@ -533,6 +535,7 @@ public function testPreviousDetectedIllegalNewNonCascadedEntitiesAreCleanedUpOnS
533535 public function testCommitThrowOptimisticLockExceptionWhenConnectionCommitFails (): void
534536 {
535537 $ platform = $ this ->getMockBuilder (AbstractPlatform::class)
538+ ->setConstructorArgs (enum_exists (UnquotedIdentifierFolding::class) ? [UnquotedIdentifierFolding::UPPER ] : [])
536539 ->onlyMethods (['supportsIdentityColumns ' ])
537540 ->getMockForAbstractClass ();
538541 $ platform ->method ('supportsIdentityColumns ' )
Original file line number Diff line number Diff line change 99use Doctrine \DBAL \Driver \Result ;
1010use Doctrine \DBAL \Platforms \AbstractPlatform ;
1111use Doctrine \DBAL \Schema \AbstractSchemaManager ;
12+ use Doctrine \DBAL \Schema \Name \UnquotedIdentifierFolding ;
1213use Doctrine \DBAL \Schema \SchemaConfig ;
1314use Doctrine \ORM \Cache \CacheConfiguration ;
1415use Doctrine \ORM \Cache \CacheFactory ;
2122use Psr \Cache \CacheItemPoolInterface ;
2223use Symfony \Component \Cache \Adapter \ArrayAdapter ;
2324
25+ use function enum_exists ;
2426use function method_exists ;
2527use function realpath ;
2628use function sprintf ;
@@ -158,6 +160,7 @@ private function createPlatformMock(): AbstractPlatform
158160 ->willReturn (new SchemaConfig ());
159161
160162 $ platform = $ this ->getMockBuilder (AbstractPlatform::class)
163+ ->setConstructorArgs (enum_exists (UnquotedIdentifierFolding::class) ? [UnquotedIdentifierFolding::UPPER ] : [])
161164 ->onlyMethods (['supportsIdentityColumns ' , 'createSchemaManager ' ])
162165 ->getMockForAbstractClass ();
163166 $ platform ->method ('supportsIdentityColumns ' )
You can’t perform that action at this time.
0 commit comments