Skip to content

Commit bc4c413

Browse files
committed
[DoctrineBridge] Cleanup tests
1 parent da94e91 commit bc4c413

40 files changed

+1
-387
lines changed

Tests/DoctrineTestHelper.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Tests;
1313

14-
use Doctrine\Common\Annotations\AnnotationReader;
1514
use Doctrine\Common\EventManager;
1615
use Doctrine\DBAL\DriverManager;
1716
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
1817
use Doctrine\ORM\Configuration;
1918
use Doctrine\ORM\EntityManager;
20-
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
2119
use Doctrine\ORM\Mapping\Driver\AttributeDriver;
2220
use Doctrine\ORM\Mapping\Driver\XmlDriver;
2321
use Doctrine\ORM\ORMSetup;
@@ -64,11 +62,7 @@ public static function createTestConfiguration(): Configuration
6462
$config->setAutoGenerateProxyClasses(true);
6563
$config->setProxyDir(sys_get_temp_dir());
6664
$config->setProxyNamespace('SymfonyTests\Doctrine');
67-
if (class_exists(AttributeDriver::class)) {
68-
$config->setMetadataDriverImpl(new AttributeDriver([__DIR__.'/../Tests/Fixtures' => 'Symfony\Bridge\Doctrine\Tests\Fixtures'], true));
69-
} else {
70-
$config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader(), null, true));
71-
}
65+
$config->setMetadataDriverImpl(new AttributeDriver([__DIR__.'/../Tests/Fixtures' => 'Symfony\Bridge\Doctrine\Tests\Fixtures'], true));
7266
if (class_exists(DefaultSchemaManagerFactory::class)) {
7367
$config->setSchemaManagerFactory(new DefaultSchemaManagerFactory());
7468
}

Tests/Fixtures/AssociationEntity.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,22 @@
1313

1414
use Doctrine\ORM\Mapping as ORM;
1515

16-
/**
17-
* @ORM\Entity
18-
*/
1916
#[ORM\Entity]
2017
class AssociationEntity
2118
{
2219
/**
2320
* @var int
24-
* @ORM\Id @ORM\GeneratedValue
25-
* @ORM\Column(type="integer")
2621
*/
2722
#[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
2823
private $id;
2924

3025
/**
31-
* @ORM\ManyToOne(targetEntity="SingleIntIdEntity")
32-
*
3326
* @var \Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity
3427
*/
3528
#[ORM\ManyToOne(targetEntity: SingleIntIdEntity::class)]
3629
public $single;
3730

3831
/**
39-
* @ORM\ManyToOne(targetEntity="CompositeIntIdEntity")
40-
* @ORM\JoinColumns({
41-
* @ORM\JoinColumn(name="composite_id1", referencedColumnName="id1"),
42-
* @ORM\JoinColumn(name="composite_id2", referencedColumnName="id2")
43-
* })
44-
*
4532
* @var \Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIntIdEntity
4633
*/
4734
#[ORM\ManyToOne(targetEntity: CompositeIntIdEntity::class)]

Tests/Fixtures/AssociationEntity2.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,22 @@
1313

1414
use Doctrine\ORM\Mapping as ORM;
1515

16-
/**
17-
* @ORM\Entity
18-
*/
1916
#[ORM\Entity]
2017
class AssociationEntity2
2118
{
2219
/**
2320
* @var int
24-
* @ORM\Id @ORM\GeneratedValue
25-
* @ORM\Column(type="integer")
2621
*/
2722
#[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
2823
private $id;
2924

3025
/**
31-
* @ORM\ManyToOne(targetEntity="SingleIntIdNoToStringEntity")
32-
*
3326
* @var \Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdNoToStringEntity
3427
*/
3528
#[ORM\ManyToOne(targetEntity: SingleIntIdNoToStringEntity::class)]
3629
public $single;
3730

3831
/**
39-
* @ORM\ManyToOne(targetEntity="CompositeIntIdEntity")
40-
* @ORM\JoinColumns({
41-
* @ORM\JoinColumn(name="composite_id1", referencedColumnName="id1"),
42-
* @ORM\JoinColumn(name="composite_id2", referencedColumnName="id2")
43-
* })
44-
*
4532
* @var \Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIntIdEntity
4633
*/
4734
#[ORM\ManyToOne(targetEntity: CompositeIntIdEntity::class)]

Tests/Fixtures/Bundles/AnnotationsBundle/Entity/Person.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@
1515
use Doctrine\ORM\Mapping\Entity;
1616
use Doctrine\ORM\Mapping\Id;
1717

18-
/**
19-
* @Entity
20-
*/
2118
#[Entity]
2219
class Person
2320
{
24-
/** @Id @Column(type="integer") */
2521
#[Id, Column(type: 'integer')]
2622
protected $id;
2723

28-
/** @Column(type="string") */
2924
#[Column(type: 'string')]
3025
public $name;
3126

Tests/Fixtures/Bundles/AnnotationsOneLineBundle/Entity/Person.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@
1515
use Doctrine\ORM\Mapping\Entity;
1616
use Doctrine\ORM\Mapping\Id;
1717

18-
/** @Entity */
1918
#[Entity]
2019
class Person
2120
{
22-
/** @Id @Column(type="integer") */
2321
#[Id, Column(type: 'integer')]
2422
protected $id;
2523

26-
/** @Column(type="string") */
2724
#[Column(type: 'string')]
2825
public $name;
2926

Tests/Fixtures/Bundles/AttributesBundle/AnnotatedEntity/Person.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@
1515
use Doctrine\ORM\Mapping\Entity;
1616
use Doctrine\ORM\Mapping\Id;
1717

18-
/**
19-
* @Entity
20-
*/
2118
#[Entity]
2219
class Person
2320
{
24-
/** @Id @Column(type="integer") */
2521
#[Id, Column(type: 'integer')]
2622
protected $id;
2723

28-
/** @Column(type="string") */
2924
#[Column(type: 'string')]
3025
public $name;
3126

Tests/Fixtures/Bundles/FullEmbeddableAnnotationsBundle/Entity/Address.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,15 @@
1414
use Doctrine\ORM\Mapping\Column;
1515
use Doctrine\ORM\Mapping\Embeddable;
1616

17-
/**
18-
* @Embeddable
19-
*/
2017
#[Embeddable]
2118
class Address
2219
{
23-
24-
/** @Column(type="string") */
2520
#[Column(type: 'string')]
2621
public $street;
2722

28-
/** @Column(type="string") */
2923
#[Column(type: 'string')]
3024
public $zipCode;
3125

32-
/** @Column(type="string") */
3326
#[Column(type: 'string')]
3427
public $city;
3528

Tests/Fixtures/Bundles/NewAnnotationsBundle/src/Entity/Person.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@
1515
use Doctrine\ORM\Mapping\Entity;
1616
use Doctrine\ORM\Mapping\Id;
1717

18-
/**
19-
* @Entity
20-
*/
2118
#[Entity]
2219
class Person
2320
{
24-
/** @Id @Column(type="integer") */
2521
#[Id, Column(type: 'integer')]
2622
protected $id;
2723

28-
/** @Column(type="string") */
2924
#[Column(type: 'string')]
3025
public $name;
3126

Tests/Fixtures/CompositeIntIdEntity.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,15 @@
1515
use Doctrine\ORM\Mapping\Entity;
1616
use Doctrine\ORM\Mapping\Id;
1717

18-
/** @Entity */
1918
#[Entity]
2019
class CompositeIntIdEntity
2120
{
22-
/** @Id @Column(type="integer") */
2321
#[Id, Column(type: 'integer')]
2422
protected $id1;
2523

26-
/** @Id @Column(type="integer") */
2724
#[Id, Column(type: 'integer')]
2825
protected $id2;
2926

30-
/** @Column(type="string") */
3127
#[Column(type: 'string')]
3228
public $name;
3329

Tests/Fixtures/CompositeObjectNoToStringIdEntity.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,12 @@
1515

1616
/**
1717
* an entity that has two objects (class without toString methods) as primary key.
18-
*
19-
* @ORM\Entity
2018
*/
2119
#[ORM\Entity]
2220
class CompositeObjectNoToStringIdEntity
2321
{
2422
/**
2523
* @var SingleIntIdNoToStringEntity
26-
*
27-
* @ORM\Id
28-
* @ORM\ManyToOne(targetEntity="SingleIntIdNoToStringEntity", cascade={"persist"})
29-
* @ORM\JoinColumn(name="object_one_id")
3024
*/
3125
#[ORM\Id]
3226
#[ORM\ManyToOne(targetEntity: SingleIntIdNoToStringEntity::class, cascade: ['persist'])]
@@ -35,10 +29,6 @@ class CompositeObjectNoToStringIdEntity
3529

3630
/**
3731
* @var SingleIntIdNoToStringEntity
38-
*
39-
* @ORM\Id
40-
* @ORM\ManyToOne(targetEntity="SingleIntIdNoToStringEntity", cascade={"persist"})
41-
* @ORM\JoinColumn(name="object_two_id")
4232
*/
4333
#[ORM\Id]
4434
#[ORM\ManyToOne(targetEntity: SingleIntIdNoToStringEntity::class, cascade: ['persist'])]

0 commit comments

Comments
 (0)