Completed
Pull Request — 2.6 (#7630)
by
unknown
06:39
created

GH7629Test::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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