From c456e4c7881a0406710b03051d6965b174f7eda5 Mon Sep 17 00:00:00 2001 From: "Jonathan.Wage" Date: Wed, 9 Jan 2008 15:59:34 +0000 Subject: [PATCH] Merged test case from 0.9 for testing loading NestedSet in setUp() method --- tests/NestedSet/LoadInSetUpTestCase.php | 57 +++++++++++++++++++++++++ tests/run.php | 1 + 2 files changed, 58 insertions(+) create mode 100644 tests/NestedSet/LoadInSetUpTestCase.php diff --git a/tests/NestedSet/LoadInSetUpTestCase.php b/tests/NestedSet/LoadInSetUpTestCase.php new file mode 100644 index 000000000..9d895faa9 --- /dev/null +++ b/tests/NestedSet/LoadInSetUpTestCase.php @@ -0,0 +1,57 @@ +. + */ + +/** + * Doctrine_NestedSet_LoadInSetUp_TestCase + * + * @package Doctrine + * @author Konsta Vesterinen + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision$ + */ +class Doctrine_NestedSet_LoadInSetUp_TestCase extends Doctrine_UnitTestCase +{ + public function prepareTables() + { + $this->tables[] = 'CategoryNestedSet'; + parent::prepareTables(); + } + + public function testNestedSet() + { + $category = new CategoryNestedSet(); + + if ( ! $category->getTable()->hasColumn('lft')) { + $this->fail(); + } + + if ( ! $category->getTable()->hasColumn('rgt')) { + $this->fail(); + } + + if ( ! $category->getTable()->hasColumn('level')) { + $this->fail(); + } + } +} \ No newline at end of file diff --git a/tests/run.php b/tests/run.php index 060cbc5e3..62c6523e3 100644 --- a/tests/run.php +++ b/tests/run.php @@ -249,6 +249,7 @@ $test->addTestCase(new Doctrine_Inheritance_TablePerClass_TestCase()); // nestedset tests $test->addTestCase(new Doctrine_NestedSet_SingleRoot_TestCase()); +$test->addTestCase(new Doctrine_NestedSet_LoadInSetUp_TestCase()); // Search tests $search = new GroupTest('Search tests','search');