diff --git a/tests/TableTestCase.php b/tests/TableTestCase.php index acf3ea03a..943745198 100644 --- a/tests/TableTestCase.php +++ b/tests/TableTestCase.php @@ -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()