Completed
Push — master ( e8eaf8...d8f671 )
by Marco
24s queued 17s
created

testClearScheduledForSynchronizationWhenCommitEmpty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\ORM\Functional\Ticket;
6
7
use Doctrine\ORM\Annotation as ORM;
8
use Doctrine\Tests\OrmFunctionalTestCase;
9
10
class GH7629Test extends OrmFunctionalTestCase
11
{
12
    /**
13
     * {@inheritDoc}
14
     */
15
    protected function setUp() : void
16
    {
17
        parent::setUp();
18
19
        $this->setUpEntitySchema([
20
            GH7629Entity::class,
21
        ]);
22
23
        $this->em->persist(new GH7629Entity());
24
        $this->em->flush();
25
        $this->em->clear();
26
    }
27
28
    public function testClearScheduledForSynchronizationWhenCommitEmpty() : void
29
    {
30
        $entity = $this->em->find(GH7629Entity::class, 1);
31
32
        $this->em->persist($entity);
33
        $this->em->flush();
34
35
        self::assertFalse($this->em->getUnitOfWork()->isScheduledForDirtyCheck($entity));
36
    }
37
}
38
39
/**
40
 * @ORM\Entity
41
 * @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
42
 */
43
class GH7629Entity
44
{
45
    /**
46
     * @ORM\Id
47
     * @ORM\Column(type="integer")
48
     * @ORM\GeneratedValue
49
     */
50
    public $id;
51
}
52