Commit 765c06b7 authored by romanb's avatar romanb

Improved some tests.

parent 3e6a352a
...@@ -624,6 +624,8 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase { ...@@ -624,6 +624,8 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase {
$user->name = "John Locke"; $user->name = "John Locke";
$user->save(); $user->save();
$this->assertTrue(is_numeric($user->id) && $user->id > 0);
$this->assertTrue($user->getModified() == array()); $this->assertTrue($user->getModified() == array());
$this->assertTrue($user->getState() == Doctrine_Record::STATE_CLEAN); $this->assertTrue($user->getState() == Doctrine_Record::STATE_CLEAN);
......
...@@ -42,6 +42,7 @@ class Doctrine_RelationAccessTestCase extends Doctrine_UnitTestCase { ...@@ -42,6 +42,7 @@ class Doctrine_RelationAccessTestCase extends Doctrine_UnitTestCase {
$us[1]->MyOtherThing->add($o); $us[1]->MyOtherThing->add($o);
} }
// UserOneThings // UserOneThings
/* Doctrine assigns the foreign keys automatically
$one_id_gs = array( $one_id_gs = array(
array(array(2,3,6,5,1), 1) array(array(2,3,6,5,1), 1)
); );
...@@ -63,7 +64,7 @@ class Doctrine_RelationAccessTestCase extends Doctrine_UnitTestCase { ...@@ -63,7 +64,7 @@ class Doctrine_RelationAccessTestCase extends Doctrine_UnitTestCase {
$uo->user_id = $oth_ids[1]; $uo->user_id = $oth_ids[1];
} }
} }
*/
$this->connection->flush(); $this->connection->flush();
$this->connection->clear(); $this->connection->clear();
} }
...@@ -76,7 +77,7 @@ class Doctrine_RelationAccessTestCase extends Doctrine_UnitTestCase { ...@@ -76,7 +77,7 @@ class Doctrine_RelationAccessTestCase extends Doctrine_UnitTestCase {
"MyUserOtherThing"); "MyUserOtherThing");
parent::prepareTables(); parent::prepareTables();
} }
/**
public function testOneToOneAggregateRelationFetching() { public function testOneToOneAggregateRelationFetching() {
$coll = $this->connection->query("FROM File_Owner.Data_File WHERE File_Owner.name = 'owner1'"); $coll = $this->connection->query("FROM File_Owner.Data_File WHERE File_Owner.name = 'owner1'");
$this->assertTrue(count($coll) == 1); $this->assertTrue(count($coll) == 1);
...@@ -138,7 +139,7 @@ class Doctrine_RelationAccessTestCase extends Doctrine_UnitTestCase { ...@@ -138,7 +139,7 @@ class Doctrine_RelationAccessTestCase extends Doctrine_UnitTestCase {
$this->assertEqual(1, $file2->get('id')); $this->assertEqual(1, $file2->get('id'));
} }
*/
public function testMultipleLeftJoinBranches() { public function testMultipleLeftJoinBranches() {
$query = "FROM MyUserOtherThing"; $query = "FROM MyUserOtherThing";
$other = $this->connection->query($query); $other = $this->connection->query($query);
......
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