forked from doctrine/orm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 2.9.x: Run PHP 8.1 CI with stable dependencies (doctrine#9058) Duplicate testTwoIterateHydrations (doctrine#9048) Add PHP 8.1 to CI (doctrine#9006) Fix locking non-existing entity (doctrine#9053) Signed-off-by: Alexander M. Turek <[email protected]>
- Loading branch information
Showing
4 changed files
with
132 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests\ORM\Functional\Ticket; | ||
|
||
use Doctrine\DBAL\LockMode; | ||
use Doctrine\ORM\Mapping\Column; | ||
use Doctrine\ORM\Mapping\Entity; | ||
use Doctrine\ORM\Mapping\GeneratedValue; | ||
use Doctrine\ORM\Mapping\Id; | ||
use Doctrine\ORM\Mapping\Version; | ||
use Doctrine\Tests\OrmFunctionalTestCase; | ||
|
||
class GH8663Test extends OrmFunctionalTestCase | ||
{ | ||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->_schemaTool->createSchema([ | ||
$this->_em->getClassMetadata(GH8663VersionedEntity::class), | ||
]); | ||
} | ||
|
||
protected function tearDown(): void | ||
{ | ||
$this->_schemaTool->dropSchema([ | ||
$this->_em->getClassMetadata(GH8663VersionedEntity::class), | ||
]); | ||
|
||
parent::tearDown(); | ||
} | ||
|
||
public function testDeletedEntity(): void | ||
{ | ||
$result = $this->_em->find(GH8663VersionedEntity::class, 1, LockMode::OPTIMISTIC); | ||
|
||
$this->assertNull($result); | ||
} | ||
} | ||
|
||
/** | ||
* @Entity | ||
*/ | ||
class GH8663VersionedEntity | ||
{ | ||
/** | ||
* @Id | ||
* @Column(type="integer") | ||
* @GeneratedValue | ||
* @var int | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @Version | ||
* @Column(type="integer") | ||
* @var int | ||
*/ | ||
protected $version; | ||
} |