Commit be9d3599 authored by meus's avatar meus

Fixed indentation and other issues related to coding style

parent 34cce3e0
This diff is collapsed.
...@@ -32,36 +32,35 @@ ...@@ -32,36 +32,35 @@
*/ */
class Doctrine_ColumnAggregationInheritance_TestCase extends Doctrine_UnitTestCase class Doctrine_ColumnAggregationInheritance_TestCase extends Doctrine_UnitTestCase
{ {
protected $otherEntity = null; protected $otherEntity = null;
public function prepareData() public function prepareData()
{ {
parent::prepareData(); parent::prepareData();
//we create a test entity that is not a user and not a group //we create a test entity that is not a user and not a group
$entity = new Entity(); $entity = new Entity();
$entity->name="Other Entity"; $entity->name='Other Entity';
$entity->type = 2; $entity->type = 2;
$entity->save(); $entity->save();
$this->otherEntity = $entity; $this->otherEntity = $entity;
} }
public function testQueriedClassReturnedIfNoSubclassMatch()
{
$q = new Doctrine_Query();
$entityOther = $q->from("Entity")->where("id=?")->execute(array($this->otherEntity->id))->getFirst();
$this->assertTrue($entityOther instanceOf Entity);
}
public function testSubclassReturnedIfInheritanceMatches()
{
$q = new Doctrine_Query();
$group = $q->from("Entity")->where("id=?")->execute(array(1))->getFirst();
$this->assertTrue($group instanceOf Group);
$q = new Doctrine_Query(); public function testQueriedClassReturnedIfNoSubclassMatch()
$user = $q->from("Entity")->where("id=?")->execute(array(5))->getFirst(); {
$this->assertTrue($user instanceOf User); $q = new Doctrine_Query();
} $entityOther = $q->from('Entity')->where('id=?')->execute(array($this->otherEntity->id))->getFirst();
} $this->assertTrue($entityOther instanceOf Entity);
}
public function testSubclassReturnedIfInheritanceMatches()
{
$q = new Doctrine_Query();
$group = $q->from('Entity')->where('id=?')->execute(array(1))->getFirst();
$this->assertTrue($group instanceOf Group);
$q = new Doctrine_Query();
$user = $q->from('Entity')->where('id=?')->execute(array(5))->getFirst();
$this->assertTrue($user instanceOf User);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment