Skip to content

Commit a4e076e

Browse files
committed
[Tree] Simplified closure test and added assertions to ensure future validity
1 parent ee48633 commit a4e076e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tests/Gedmo/Tree/ClosureTreeTest.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -361,20 +361,21 @@ public function testPersistOnRightEmInstance()
361361
$emOne = $this->getMockSqliteEntityManager($evm);
362362
$emTwo = $this->getMockSqliteEntityManager($evm);
363363

364-
$politicsOne = new Category();
365-
$politicsOne->setTitle('Politics');
366-
$newsOne = new News('Lorem ipsum', $politicsOne);
364+
$categoryOne = new Category();
365+
$categoryOne->setTitle('Politics');
367366

368-
$politicsTwo = new Category();
369-
$politicsTwo->setTitle('Politics');
370-
$newsTwo = new News('Lorem ipsum', $politicsTwo);
367+
$categoryTwo = new Category();
368+
$categoryTwo->setTitle('Politics');
371369

372370
// Persist and Flush on different times !
373-
$emOne->persist($newsOne);
371+
$emOne->persist($categoryOne);
374372

375-
$emTwo->persist($newsTwo);
373+
$emTwo->persist($categoryTwo);
376374
$emTwo->flush();
377375

378376
$emOne->flush();
377+
378+
$this->assertNotNull($categoryOne->getId());
379+
$this->assertNotNull($categoryTwo->getId());
379380
}
380381
}

0 commit comments

Comments
 (0)