improving (and breaking) find() test cases, refs #168
This commit is contained in:
parent
da6f4a3849
commit
716a91e511
@ -111,8 +111,33 @@ class Doctrine_TableTestCase extends Doctrine_UnitTestCase {
|
|||||||
$record = $this->objTable->find(4);
|
$record = $this->objTable->find(4);
|
||||||
$this->assertTrue($record instanceof Doctrine_Record);
|
$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 {
|
try {
|
||||||
$record = $this->objTable->find(123);
|
$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) {
|
} catch(Exception $e) {
|
||||||
$this->assertTrue($e instanceOf Doctrine_Find_Exception);
|
$this->assertTrue($e instanceOf Doctrine_Find_Exception);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user