Skip to content

Commit ad5c8e4

Browse files
committed
Make test compatible with PHP 7.1
1 parent c363f55 commit ad5c8e4

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

tests/Tests/ORM/Functional/Ticket/GH6123Test.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Doctrine\DBAL\Types\Types;
88
use Doctrine\ORM\Mapping as ORM;
9-
use Doctrine\ORM\Mapping\Column;
109
use Doctrine\ORM\UnitOfWork;
1110
use Doctrine\Tests\OrmFunctionalTestCase;
1211

@@ -17,7 +16,7 @@ protected function setUp(): void
1716
parent::setUp();
1817

1918
$this->createSchemaForModels(
20-
GH6123Entity::class,
19+
GH6123Entity::class
2120
);
2221
}
2322

@@ -58,7 +57,7 @@ public function testRemovedEntityCanBePersistedAgain(): void
5857
$this->_em->flush();
5958
}
6059

61-
private function loadEntityFromDatabase(int $id): GH6123Entity|null
60+
private function loadEntityFromDatabase(int $id): ?GH6123Entity
6261
{
6362
return $this->_em->createQueryBuilder()
6463
->select('e')
@@ -70,11 +69,20 @@ private function loadEntityFromDatabase(int $id): GH6123Entity|null
7069
}
7170
}
7271

72+
/**
73+
* @ORM\Entity
74+
*/
7375
#[ORM\Entity]
7476
class GH6123Entity
7577
{
78+
/**
79+
* @ORM\Id
80+
* @ORM\GeneratedValue
81+
* @ORM\Column(type="integer")
82+
* @var int
83+
*/
7684
#[ORM\Id]
7785
#[ORM\GeneratedValue]
78-
#[Column(type: Types::INTEGER, nullable: false)]
79-
public int $id;
86+
#[ORM\Column(type: Types::INTEGER)]
87+
public $id;
8088
}

0 commit comments

Comments
 (0)