Skip to content

Commit 11f6da9

Browse files
Geekimojrushlow
authored andcommitted
fix: Fix tests
1 parent 5ec055a commit 11f6da9

38 files changed

+84
-50
lines changed

tests/Util/fixtures/add_entity_field/User_simple.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class User
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

15-
#[ORM\Column(type: 'string', length: 255, nullable: false, options: ['comment' => 'new field'])]
16+
#[ORM\Column(type: Types::STRING, length: 255, nullable: false, options: ['comment' => 'new field'])]
1617
private $fooProp;
1718

1819
public function getId(): ?int

tests/Util/fixtures/add_entity_field/User_simple_datetime.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class User
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

15-
#[ORM\Column(type: 'datetime', nullable: true)]
16+
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
1617
private $createdAt;
1718

1819
public function getId(): ?int

tests/Util/fixtures/add_entity_field/User_simple_prop_already_exists.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class User
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

1516
#[ORM\Column]

tests/Util/fixtures/add_entity_field/User_simple_prop_zero.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class User
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

15-
#[ORM\Column(type: 'decimal', precision: 6, scale: 0)]
16+
#[ORM\Column(type: Types::DECIMAL, precision: 6, scale: 0)]
1617
private $decimal;
1718

1819
public function getId(): ?int

tests/Util/fixtures/add_many_to_many_relation/User_simple_inverse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
use Doctrine\Common\Collections\ArrayCollection;
66
use Doctrine\Common\Collections\Collection;
7+
use Doctrine\DBAL\Types\Types;
78
use Doctrine\ORM\Mapping as ORM;
89

910
#[ORM\Entity]
1011
class User
1112
{
1213
#[ORM\Id]
1314
#[ORM\GeneratedValue]
14-
#[ORM\Column(type: 'integer')]
15+
#[ORM\Column(type: Types::INTEGER)]
1516
private $id;
1617

1718
#[ORM\ManyToMany(targetEntity: Recipe::class, mappedBy: 'foods')]

tests/Util/fixtures/add_many_to_many_relation/User_simple_no_inverse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
use Doctrine\Common\Collections\ArrayCollection;
66
use Doctrine\Common\Collections\Collection;
7+
use Doctrine\DBAL\Types\Types;
78
use Doctrine\ORM\Mapping as ORM;
89

910
#[ORM\Entity]
1011
class User
1112
{
1213
#[ORM\Id]
1314
#[ORM\GeneratedValue]
14-
#[ORM\Column(type: 'integer')]
15+
#[ORM\Column(type: Types::INTEGER)]
1516
private $id;
1617

1718
#[ORM\ManyToMany(targetEntity: Recipe::class)]

tests/Util/fixtures/add_many_to_many_relation/User_simple_owning.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
use Doctrine\Common\Collections\ArrayCollection;
66
use Doctrine\Common\Collections\Collection;
7+
use Doctrine\DBAL\Types\Types;
78
use Doctrine\ORM\Mapping as ORM;
89

910
#[ORM\Entity]
1011
class User
1112
{
1213
#[ORM\Id]
1314
#[ORM\GeneratedValue]
14-
#[ORM\Column(type: 'integer')]
15+
#[ORM\Column(type: Types::INTEGER)]
1516
private $id;
1617

1718
#[ORM\ManyToMany(targetEntity: Recipe::class, inversedBy: 'foods')]

tests/Util/fixtures/add_many_to_one_relation/User_simple_no_inverse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class User
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

1516
#[ORM\ManyToOne(targetEntity: Category::class)]

tests/Util/fixtures/add_many_to_one_relation/User_simple_not_nullable.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class User
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

1516
#[ORM\ManyToOne(targetEntity: Category::class, inversedBy: 'foods')]

tests/Util/fixtures/add_many_to_one_relation/User_simple_nullable.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class User
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

1516
#[ORM\ManyToOne(targetEntity: Category::class, inversedBy: 'foods')]

tests/Util/fixtures/add_many_to_one_relation/User_simple_other_namespace.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67
use Foo\Entity\Category;
78

@@ -10,7 +11,7 @@ class User
1011
{
1112
#[ORM\Id]
1213
#[ORM\GeneratedValue]
13-
#[ORM\Column(type: 'integer')]
14+
#[ORM\Column(type: Types::INTEGER)]
1415
private $id;
1516

1617
#[ORM\ManyToOne(targetEntity: Category::class, inversedBy: 'foods')]

tests/Util/fixtures/add_one_to_many_relation/User_simple.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
use Doctrine\Common\Collections\ArrayCollection;
66
use Doctrine\Common\Collections\Collection;
7+
use Doctrine\DBAL\Types\Types;
78
use Doctrine\ORM\Mapping as ORM;
89

910
#[ORM\Entity]
1011
class User
1112
{
1213
#[ORM\Id]
1314
#[ORM\GeneratedValue]
14-
#[ORM\Column(type: 'integer')]
15+
#[ORM\Column(type: Types::INTEGER)]
1516
private $id;
1617

1718
#[ORM\OneToMany(mappedBy: 'user', targetEntity: UserAvatarPhoto::class)]

tests/Util/fixtures/add_one_to_many_relation/User_simple_orphan_removal.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
use Doctrine\Common\Collections\ArrayCollection;
66
use Doctrine\Common\Collections\Collection;
7+
use Doctrine\DBAL\Types\Types;
78
use Doctrine\ORM\Mapping as ORM;
89

910
#[ORM\Entity]
1011
class User
1112
{
1213
#[ORM\Id]
1314
#[ORM\GeneratedValue]
14-
#[ORM\Column(type: 'integer')]
15+
#[ORM\Column(type: Types::INTEGER)]
1516
private $id;
1617

1718
#[ORM\OneToMany(mappedBy: 'user', targetEntity: UserAvatarPhoto::class, orphanRemoval: true)]

tests/Util/fixtures/add_one_to_many_relation/User_with_use_statements.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Entity;
44

55
use Doctrine\Common\Collections\Collection;
6+
use Doctrine\DBAL\Types\Types;
67
use Doctrine\ORM\Mapping as ORM;
78
use Doctrine\Common\Collections\ArrayCollection;
89
use Some\Other\UserProfile;
@@ -13,7 +14,7 @@ class User
1314
{
1415
#[ORM\Id]
1516
#[ORM\GeneratedValue]
16-
#[ORM\Column(type: 'integer')]
17+
#[ORM\Column(type: Types::INTEGER)]
1718
private $id;
1819

1920
#[ORM\OneToMany(mappedBy: 'user', targetEntity: UserAvatarPhoto::class)]

tests/Util/fixtures/add_one_to_one_relation/UserProfile_simple_inverse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class UserProfile
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

1516
#[ORM\OneToOne(mappedBy: 'userProfile', targetEntity: User::class, cascade: ['persist', 'remove'])]

tests/Util/fixtures/add_one_to_one_relation/UserProfile_simple_inverse_not_nullable.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class UserProfile
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

1516
#[ORM\OneToOne(mappedBy: 'userProfile', targetEntity: User::class, cascade: ['persist', 'remove'])]

tests/Util/fixtures/add_one_to_one_relation/User_simple_no_inverse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class User
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

1516
#[ORM\OneToOne(targetEntity: UserProfile::class, cascade: ['persist', 'remove'])]

tests/Util/fixtures/add_one_to_one_relation/User_simple_no_inverse_not_nullable.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class User
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

1516
#[ORM\OneToOne(targetEntity: UserProfile::class, cascade: ['persist', 'remove'])]

tests/Util/fixtures/add_one_to_one_relation/User_simple_owning.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class User
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

1516
#[ORM\OneToOne(inversedBy: 'user', targetEntity: UserProfile::class, cascade: ['persist', 'remove'])]

tests/Util/fixtures/add_one_to_one_relation/User_simple_self.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67

78
#[ORM\Entity]
89
class User
910
{
1011
#[ORM\Id]
1112
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
13+
#[ORM\Column(type: Types::INTEGER)]
1314
private $id;
1415

1516
#[ORM\OneToOne(inversedBy: 'user', targetEntity: self::class, cascade: ['persist', 'remove'])]

tests/Util/fixtures/add_one_to_one_relation/User_with_use_statements_avoid_duplicate_use.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67
use Doctrine\Common\Collections\ArrayCollection;
78
use Some\Other\UserProfile;
@@ -12,7 +13,7 @@ class User
1213
{
1314
#[ORM\Id]
1415
#[ORM\GeneratedValue]
15-
#[ORM\Column(type: 'integer')]
16+
#[ORM\Column(type: Types::INTEGER)]
1617
private $id;
1718

1819
#[ORM\OneToOne(inversedBy: 'user', targetEntity: \App\OtherEntity\UserProfile::class, cascade: ['persist', 'remove'])]

tests/Util/fixtures/add_one_to_one_relation/User_with_use_statements_avoid_duplicate_use_alias.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Entity;
44

5+
use Doctrine\DBAL\Types\Types;
56
use Doctrine\ORM\Mapping as ORM;
67
use Doctrine\Common\Collections\ArrayCollection;
78
use Some\Other\UserProfile;
@@ -12,7 +13,7 @@ class User
1213
{
1314
#[ORM\Id]
1415
#[ORM\GeneratedValue]
15-
#[ORM\Column(type: 'integer')]
16+
#[ORM\Column(type: Types::INTEGER)]
1617
private $id;
1718

1819
#[ORM\OneToOne(inversedBy: 'user', targetEntity: \App\OtherEntity\Category::class, cascade: ['persist', 'remove'])]

tests/Util/fixtures/source/UserProfile_simple.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class UserProfile
99
{
1010
#[ORM\Id]
1111
#[ORM\GeneratedValue]
12-
#[ORM\Column(type: 'integer')]
12+
#[ORM\Column(type: Types::INTEGER)]
1313
private $id;
1414

1515
public function getId(): ?int

0 commit comments

Comments
 (0)