Completed
Pull Request — 2.6 (#7630)
by
unknown
08:24
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
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