diff --git a/tests/Doctrine/Tests/Models/VersionedOneToMany/Article.php b/tests/Doctrine/Tests/Models/VersionedManyToOne/Article.php similarity index 77% rename from tests/Doctrine/Tests/Models/VersionedOneToMany/Article.php rename to tests/Doctrine/Tests/Models/VersionedManyToOne/Article.php index 919480162..0e5b1683f 100644 --- a/tests/Doctrine/Tests/Models/VersionedOneToMany/Article.php +++ b/tests/Doctrine/Tests/Models/VersionedManyToOne/Article.php @@ -1,13 +1,15 @@ useModelSet('versioned_many_to_one'); - try { - $this->_schemaTool->createSchema( - [ - $this->_em->getClassMetadata('Doctrine\Tests\Models\VersionedOneToMany\Category'), - $this->_em->getClassMetadata('Doctrine\Tests\Models\VersionedOneToMany\Article'), - ] - ); - } catch (ORMException $e) { - } + parent::setUp(); } /** @@ -34,10 +26,9 @@ class MergeVersionedOneToManyTest extends \Doctrine\Tests\OrmFunctionalTestCase public function testSetVersionOnCreate() { $category = new Category(); - $category->name = 'Category'; + $article = new Article(); - $article = new Article(); - $article->name = 'Article'; + $article->name = 'Article'; $article->category = $category; $this->_em->persist($article); diff --git a/tests/Doctrine/Tests/OrmFunctionalTestCase.php b/tests/Doctrine/Tests/OrmFunctionalTestCase.php index d54c9cdf3..b8a705707 100644 --- a/tests/Doctrine/Tests/OrmFunctionalTestCase.php +++ b/tests/Doctrine/Tests/OrmFunctionalTestCase.php @@ -282,6 +282,10 @@ abstract class OrmFunctionalTestCase extends OrmTestCase 'Doctrine\Tests\Models\Pagination\User', 'Doctrine\Tests\Models\Pagination\User1', ), + 'versioned_many_to_one' => array( + 'Doctrine\Tests\Models\VersionedManyToOne\Category', + 'Doctrine\Tests\Models\VersionedManyToOne\Article', + ), ); /** @@ -543,6 +547,11 @@ abstract class OrmFunctionalTestCase extends OrmTestCase $conn->executeUpdate('DELETE FROM pagination_user'); } + if (isset($this->_usedModelSets['versioned_many_to_one'])) { + $conn->executeUpdate('DELETE FROM versioned_many_to_one_article'); + $conn->executeUpdate('DELETE FROM versioned_many_to_one_category'); + } + $this->_em->clear(); }