From ad5c8e4bdc93e422a284c1cdc0bf6fa6d8f4d7b3 Mon Sep 17 00:00:00 2001 From: W0rma Date: Mon, 29 Apr 2024 14:52:02 +0200 Subject: [PATCH] Make test compatible with PHP 7.1 --- .../Tests/ORM/Functional/Ticket/GH6123Test.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/Tests/ORM/Functional/Ticket/GH6123Test.php b/tests/Tests/ORM/Functional/Ticket/GH6123Test.php index 7a5f14980f..05a1a765f2 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH6123Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH6123Test.php @@ -6,7 +6,6 @@ use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; -use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\UnitOfWork; use Doctrine\Tests\OrmFunctionalTestCase; @@ -17,7 +16,7 @@ protected function setUp(): void parent::setUp(); $this->createSchemaForModels( - GH6123Entity::class, + GH6123Entity::class ); } @@ -58,7 +57,7 @@ public function testRemovedEntityCanBePersistedAgain(): void $this->_em->flush(); } - private function loadEntityFromDatabase(int $id): GH6123Entity|null + private function loadEntityFromDatabase(int $id): ?GH6123Entity { return $this->_em->createQueryBuilder() ->select('e') @@ -70,11 +69,20 @@ private function loadEntityFromDatabase(int $id): GH6123Entity|null } } +/** + * @ORM\Entity + */ #[ORM\Entity] class GH6123Entity { + /** + * @ORM\Id + * @ORM\GeneratedValue + * @ORM\Column(type="integer") + * @var int + */ #[ORM\Id] #[ORM\GeneratedValue] - #[Column(type: Types::INTEGER, nullable: false)] - public int $id; + #[ORM\Column(type: Types::INTEGER)] + public $id; }