Commit 7bff012b authored by jackbravo's avatar jackbravo

Test array fetching on table finder methods

parent 9b524636
......@@ -159,6 +159,17 @@ class Doctrine_Table_TestCase extends Doctrine_UnitTestCase
$this->assertTrue(false);
}
try {
$record = $this->objTable->find('4', Doctrine::FETCH_ARRAY);
$this->assertTrue(is_array($record));
$this->assertTrue(!is_object($record));
$this->assertTrue(array_key_exists('id', $record));
$this->assertTrue(array_key_exists('name', $record));
$this->assertTrue(! $record instanceof Doctrine_Record);
} catch(Exception $e) {
$this->assertTrue(false);
}
try {
$record = $this->objTable->find(123);
$this->assertTrue($record === false);
......@@ -186,6 +197,12 @@ class Doctrine_Table_TestCase extends Doctrine_UnitTestCase
$users = $this->objTable->findAll();
$this->assertEqual($users->count(), 8);
$this->assertTrue($users instanceof Doctrine_Collection);
$users = $this->objTable->findAll(Doctrine::FETCH_ARRAY);
$this->assertTrue(! $users instanceof Doctrine_Collection);
$this->assertTrue(is_array($users));
$this->assertTrue(!is_object($users));
$this->assertEqual(count($users), 8);
}
public function testFindByDql()
......
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