diff --git a/models/InheritanceTest.php b/models/InheritanceTest.php deleted file mode 100644 index c19d21d94..000000000 --- a/models/InheritanceTest.php +++ /dev/null @@ -1,19 +0,0 @@ -hasColumn('name', 'string'); - $this->hasColumn('type', 'string'); - - $this->setSubclasses(array('InheritanceChildTest' => array('type' => 'type 1'), - 'InheritanceChild2Test' => array('type' => 'type 2'))); - } -} - -class InheritanceChildTest extends InheritanceTest -{ } - -class InheritanceChild2Test extends InheritanceTest -{ } - diff --git a/tests/ColumnAggregationInheritanceTestCase.php b/tests/ColumnAggregationInheritanceTestCase.php index a794291ab..7c0134601 100644 --- a/tests/ColumnAggregationInheritanceTestCase.php +++ b/tests/ColumnAggregationInheritanceTestCase.php @@ -35,8 +35,8 @@ class Doctrine_ColumnAggregationInheritance_TestCase extends Doctrine_UnitTestCa { protected $otherEntity = null; - public function prepareData() - { + public function prepareData() + { parent::prepareData(); //we create a test entity that is not a user and not a group $entity = new Entity(); @@ -66,17 +66,17 @@ class Doctrine_ColumnAggregationInheritance_TestCase extends Doctrine_UnitTestCa public function testStringColumnInheritance() { $q = new Doctrine_Query(); - - $q->from('InheritanceChildTest'); - - $this->assertEqual($q->getSql(), "SELECT i.id AS i__id, i.name AS i__name, i.type AS i__type FROM inheritance_test i WHERE (i.type = 'type 1')"); + $q->select('g.name')->from('Group g'); + $this->assertEqual($q->getSql(), "SELECT e.id AS e__id, e.name AS e__name FROM entity e WHERE (e.type = 1)"); } public function testSubclassFieldSetWhenCreatingNewSubclassedRecord() { - $child = new InheritanceChildTest(); + $child = new User(); + $child->name = 'Pedro'; $this->assertTrue(isset($child->type)); - $this->assertEqual('type 1', $child->type); + $child->save(); + $this->assertEqual($child->type, '0'); } }