Passed
Pull Request — master (#7632)
by
unknown
09:32
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
0 ignored issues
show
introduced by
Missing declare(strict_types = 1).
Loading history...
2
3
namespace Doctrine\Tests\ORM\Functional\Ticket;
4
5
use Doctrine\ORM\Annotation as ORM;
6
use Doctrine\Tests\OrmFunctionalTestCase;
7
8
class GH7629Test extends OrmFunctionalTestCase
9
{
10
    /**
11
     * {@inheritDoc}
12
     */
13
    protected function setUp(): void
0 ignored issues
show
introduced by
There must be exactly 1 whitespace between closing parenthesis and return type colon.
Loading history...
14
    {
15
        parent::setUp();
16
17
        $this->setUpEntitySchema([
18
            GH7629Entity::class,
19
        ]);
20
21
        $this->em->persist(new GH7629Entity());
22
        $this->em->flush();
23
        $this->em->clear();
24
    }
25
26
    public function testClearScheduledForSynchronizationWhenCommitEmpty(): void
0 ignored issues
show
introduced by
There must be exactly 1 whitespace between closing parenthesis and return type colon.
Loading history...
27
    {
28
        $entity = $this->em->find(GH7629Entity::class, 1);
29
30
        $this->em->persist($entity);
31
        $this->em->flush();
32
33
        self::assertFalse($this->em->getUnitOfWork()->isScheduledForDirtyCheck($entity));
34
    }
35
}
36
37
/**
38
 * @ORM\Entity
39
 * @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
40
 */
41
class GH7629Entity
42
{
43
    /**
44
     * @ORM\Id
45
     * @ORM\Column(type="integer")
46
     * @ORM\GeneratedValue
47
     */
48
    public $id;
49
}
50