| @@ 78-89 (lines=12) @@ | ||
| 75 | $this->assertEquals(0, count($drivers)); |
|
| 76 | } |
|
| 77 | ||
| 78 | public function testPurge() |
|
| 79 | { |
|
| 80 | $loader = new YamlLoader($this->kernel, array('SomeBundle'), 'DataFixtures'); |
|
| 81 | $loader->loadFixtures(); |
|
| 82 | $loader->purgeDatabase('mongodb'); |
|
| 83 | ||
| 84 | $cars = $this->doctrine->getManager()->getRepository('Khepin\Fixture\Document\Car')->findAll(); |
|
| 85 | $this->assertEquals(count($cars), 0); |
|
| 86 | ||
| 87 | $drivers = $this->doctrine->getManager()->getRepository('Khepin\Fixture\Document\Driver')->findAll(); |
|
| 88 | $this->assertEquals(count($drivers), 0); |
|
| 89 | } |
|
| 90 | ||
| 91 | public function testContext() |
|
| 92 | { |
|
| @@ 109-119 (lines=11) @@ | ||
| 106 | $this->assertEquals(get_class($driver->getCar()), 'Khepin\Fixture\Entity\Car'); |
|
| 107 | } |
|
| 108 | ||
| 109 | public function testPurge() |
|
| 110 | { |
|
| 111 | $loader = new YamlLoader($this->kernel, array('SomeBundle'), 'DataFixtures'); |
|
| 112 | $loader->loadFixtures('with_drivers'); |
|
| 113 | $loader->purgeDatabase('orm'); |
|
| 114 | ||
| 115 | $cars = $this->doctrine->getEntityManager()->getRepository('Khepin\Fixture\Entity\Car')->findAll(); |
|
| 116 | $this->assertEmpty($cars); |
|
| 117 | $drivers = $this->doctrine->getEntityManager()->getRepository('Khepin\Fixture\Entity\Driver')->findAll(); |
|
| 118 | $this->assertEmpty($drivers); |
|
| 119 | } |
|
| 120 | ||
| 121 | public function testPurgeWithTruncate() |
|
| 122 | { |
|