Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function testLockModeIsRespected() |
||
24 | { |
||
25 | $entityA = new GH7286Entity('foo', 1); |
||
26 | $entityB = new GH7286Entity('foo', 2); |
||
27 | $entityC = new GH7286Entity('bar', 3); |
||
28 | |||
29 | $this->_em->persist($entityA); |
||
30 | $this->_em->persist($entityB); |
||
31 | $this->_em->persist($entityC); |
||
32 | $this->_em->flush(); |
||
33 | $this->_em->clear(); |
||
34 | |||
35 | $query = $this->_em->createQuery( |
||
36 | 'SELECT CONCAT(e.type, MIN(e.version)) pair' |
||
37 | . ' FROM ' . GH7286Entity::class . ' e' |
||
38 | . ' GROUP BY e.type ORDER BY e.type' |
||
39 | ); |
||
40 | |||
41 | self::assertSame( |
||
42 | [ |
||
43 | ['pair' => 'bar3'], |
||
44 | ['pair' => 'foo1'], |
||
45 | ], |
||
46 | $query->getArrayResult() |
||
47 | ); |
||
82 |