Skip to content

Commit

Permalink
Make test compatible with PHP 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
W0rma committed Apr 30, 2024
1 parent c363f55 commit ad5c8e4
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/Tests/ORM/Functional/Ticket/GH6123Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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

$this->createSchemaForModels(
GH6123Entity::class,
GH6123Entity::class
);
}

Expand Down Expand Up @@ -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')
Expand All @@ -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;
}

0 comments on commit ad5c8e4

Please sign in to comment.