Added Deletor trait.
This commit is contained in:
@@ -41,7 +41,9 @@ class CharacterModelTest extends ModelTestCase {
|
||||
|
||||
$entities = $this->getEntityManager()->getRepository(Character::class)
|
||||
->findAll();
|
||||
$this->assertEquals(count($entities), count($characters));
|
||||
$this->assertCount(count($characters), $entities);
|
||||
|
||||
return $entities;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,4 +65,20 @@ class CharacterModelTest extends ModelTestCase {
|
||||
$char = Character::create($faultyCharacterData);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreation
|
||||
*/
|
||||
public function testDeletion(array $characters) {
|
||||
foreach($characters as $character) {
|
||||
$character->save($this->getEntityManager());
|
||||
}
|
||||
|
||||
$character = $this->getEntityManager()->getRepository(Character::class)->find(1);
|
||||
$character->delete($this->getEntityManager());
|
||||
|
||||
$entities = $this->getEntityManager()->getRepository(Character::class)
|
||||
->findAll();
|
||||
$this->assertCount(1, $entities);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user