Skip to content

Commit

Permalink
fix test to remove entities beforehand
Browse files Browse the repository at this point in the history
as we are testing on acceptance, we have the update schema util already working
  • Loading branch information
pscheit committed Oct 29, 2013
1 parent 06e1091 commit de3e53c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion etc/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

if (getenv('TRAVIS') === 'true') {
$conf['db']['default']['user'] = 'root';
$conf['db']['default']['database'] = '';
$conf['db']['default']['password'] = '';
}

$conf['db']['tests'] = $conf['db']['default'];
Expand Down
12 changes: 10 additions & 2 deletions tests/Webforge/Doctrine/ContainerEntitiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ public function setUp() {
}

public function testEntityManagerFIndsTheEntyLoadedFromTestFiles() {
$this->assertNull($this->em->find('Doctrine\Tests\Models\Company\CompanyCar', 1));
$repo = $this->em->getRepository('Doctrine\Tests\Models\Company\CompanyCar');

foreach ($repo->findAll() as $car) {
$this->em->remove($car);
}
$this->em->flush();
$this->em->clear();

$this->assertNull($repo->find(1));

$car = new CompanyCar('Ford');
$this->em->persist($car);
Expand All @@ -25,7 +33,7 @@ public function testEntityManagerFIndsTheEntyLoadedFromTestFiles() {

$this->assertInstanceOf(
'Doctrine\Tests\Models\Company\CompanyCar',
$this->em->find('Doctrine\Tests\Models\Company\CompanyCar', 1)
$repo->find($car->getId())
);
}
}
15 changes: 0 additions & 15 deletions tests/Webforge/Doctrine/UtilTest.php

This file was deleted.

0 comments on commit de3e53c

Please sign in to comment.