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

GH7629Test   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testClearScheduledForSynchronizationWhenCommitEmpty() 0 8 1
A setUp() 0 11 1
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