Commit 716a91e5 authored by pookey's avatar pookey

improving (and breaking) find() test cases, refs #168

parent da6f4a38
......@@ -111,8 +111,33 @@ class Doctrine_TableTestCase extends Doctrine_UnitTestCase {
$record = $this->objTable->find(4);
$this->assertTrue($record instanceof Doctrine_Record);
try {
$record = $this->objTable->find('4');
$this->assertTrue($record instanceof Doctrine_Record);
} catch(Exception $e) {
$this->assertTrue($e instanceOf Doctrine_Find_Exception);
}
try {
$record = $this->objTable->find(123);
// should have thrown exception...
$this->assertTrue(false);
} catch(Exception $e) {
$this->assertTrue($e instanceOf Doctrine_Find_Exception);
}
try {
$record = $this->objTable->find(null);
// should have thrown exception...
$this->assertTrue(false);
} catch(Exception $e) {
$this->assertTrue($e instanceOf Doctrine_Find_Exception);
}
try {
$record = $this->objTable->find(false);
// should have thrown exception...
$this->assertTrue(false);
} catch(Exception $e) {
$this->assertTrue($e instanceOf Doctrine_Find_Exception);
}
......
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