|
6 | 6 |
|
7 | 7 | use Doctrine\Common\Collections\ArrayCollection;
|
8 | 8 | use Doctrine\Common\Collections\Collection;
|
9 |
| -use Doctrine\DBAL\Types\BigIntType; |
10 |
| -use Doctrine\DBAL\Types\Types; |
11 | 9 | use Doctrine\ORM\EntityManagerInterface;
|
12 | 10 | use Doctrine\ORM\Mapping\Column;
|
13 | 11 | use Doctrine\ORM\Mapping\DiscriminatorMap;
|
|
32 | 30 | use PHPUnit\Framework\Attributes\DataProvider;
|
33 | 31 | use PHPUnit\Framework\Attributes\Group;
|
34 | 32 |
|
35 |
| -use function method_exists; |
36 |
| - |
37 | 33 | class SchemaValidatorTest extends OrmTestCase
|
38 | 34 | {
|
39 | 35 | private EntityManagerInterface|null $em = null;
|
@@ -232,47 +228,6 @@ public function testInvalidAssociationTowardsMappedSuperclass(): void
|
232 | 228 | $ce,
|
233 | 229 | );
|
234 | 230 | }
|
235 |
| - |
236 |
| - public function testBigintMappedToStringInt(): void |
237 |
| - { |
238 |
| - $class = $this->em->getClassMetadata(BigintMappedToStringInt::class); |
239 |
| - $ce = $this->validator->validateClass($class); |
240 |
| - |
241 |
| - $this->assertEquals([], $ce); // Same for DBAL 3 and 4+ |
242 |
| - } |
243 |
| - |
244 |
| - public function testBigintMappedToInt(): void |
245 |
| - { |
246 |
| - $class = $this->em->getClassMetadata(BigintMappedToInt::class); |
247 |
| - $ce = $this->validator->validateClass($class); |
248 |
| - |
249 |
| - if (method_exists(BigIntType::class, 'getName')) { // DBAL 3 |
250 |
| - $this->assertEquals( |
251 |
| - ["The field 'Doctrine\Tests\ORM\Tools\BigintMappedToInt#bigint' has the property type 'int' that differs from the metadata field type 'string' returned by the 'bigint' DBAL type."], |
252 |
| - $ce, |
253 |
| - ); |
254 |
| - } else { // DBAL 4+ |
255 |
| - $this->assertEquals( |
256 |
| - ["The field 'Doctrine\Tests\ORM\Tools\BigintMappedToInt#bigint' has the property type 'int' that differs from the metadata field type 'string|int' returned by the 'bigint' DBAL type."], |
257 |
| - $ce, |
258 |
| - ); |
259 |
| - } |
260 |
| - } |
261 |
| - |
262 |
| - public function testBigintMappedToString(): void |
263 |
| - { |
264 |
| - $class = $this->em->getClassMetadata(BigintMappedToString::class); |
265 |
| - $ce = $this->validator->validateClass($class); |
266 |
| - |
267 |
| - if (method_exists(BigIntType::class, 'getName')) { // DBAL 3 |
268 |
| - $this->assertEquals([], $ce); |
269 |
| - } else { // DBAL 4+ |
270 |
| - $this->assertEquals( |
271 |
| - ["The field 'Doctrine\Tests\ORM\Tools\BigintMappedToString#bigint' has the property type 'string' that differs from the metadata field type 'string|int' returned by the 'bigint' DBAL type."], |
272 |
| - $ce, |
273 |
| - ); |
274 |
| - } |
275 |
| - } |
276 | 231 | }
|
277 | 232 |
|
278 | 233 | #[MappedSuperclass]
|
@@ -592,39 +547,3 @@ class InvalidMappedSuperClass
|
592 | 547 | #[ManyToMany(targetEntity: 'InvalidMappedSuperClass', mappedBy: 'invalid')]
|
593 | 548 | private $selfWhatever;
|
594 | 549 | }
|
595 |
| - |
596 |
| -#[Entity] |
597 |
| -class BigintMappedToStringInt |
598 |
| -{ |
599 |
| - #[Id] |
600 |
| - #[Column] |
601 |
| - #[GeneratedValue] |
602 |
| - private int $id; |
603 |
| - |
604 |
| - #[Column(type: Types::BIGINT)] |
605 |
| - private string|int $bigint; |
606 |
| -} |
607 |
| - |
608 |
| -#[Entity] |
609 |
| -class BigintMappedToInt |
610 |
| -{ |
611 |
| - #[Id] |
612 |
| - #[Column] |
613 |
| - #[GeneratedValue] |
614 |
| - private int $id; |
615 |
| - |
616 |
| - #[Column(type: Types::BIGINT)] |
617 |
| - private int $bigint; |
618 |
| -} |
619 |
| - |
620 |
| -#[Entity] |
621 |
| -class BigintMappedToString |
622 |
| -{ |
623 |
| - #[Id] |
624 |
| - #[Column] |
625 |
| - #[GeneratedValue] |
626 |
| - private int $id; |
627 |
| - |
628 |
| - #[Column(type: Types::BIGINT)] |
629 |
| - private string $bigint; |
630 |
| -} |
0 commit comments