From d0e5966d7ed3353c44375efe7d518de3f4f32501 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 --- .../ORM/Functional/Ticket/GH6123Test.php | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/Tests/ORM/Functional/Ticket/GH6123Test.php b/tests/Tests/ORM/Functional/Ticket/GH6123Test.php index 7a5f14980f..afa00e7a32 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,10 @@ public function testRemovedEntityCanBePersistedAgain(): void $this->_em->flush(); } - private function loadEntityFromDatabase(int $id): GH6123Entity|null + /** + * @return GH6123Entity|null + */ + private function loadEntityFromDatabase(int $id) { return $this->_em->createQueryBuilder() ->select('e') @@ -70,11 +72,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; }