From 716a91e511799b8fd4b124a10d4ffa4b7c6d2a54 Mon Sep 17 00:00:00 2001 From: pookey Date: Sun, 15 Oct 2006 17:15:16 +0000 Subject: [PATCH] improving (and breaking) find() test cases, refs #168 --- tests/TableTestCase.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/TableTestCase.php b/tests/TableTestCase.php index 6e187f160..52b41aea6 100644 --- a/tests/TableTestCase.php +++ b/tests/TableTestCase.php @@ -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); }