From dc3bf922d9715bfd1b2105be04a9aabc84a1d7d4 Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 12 Apr 2007 08:05:03 +0000 Subject: Refactor and add TTableGateway, System.Data.Common, System.Data.DataGateway --- tests/simple_unit/TableGateway/MagicCallTest.php | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/simple_unit/TableGateway/MagicCallTest.php (limited to 'tests/simple_unit/TableGateway/MagicCallTest.php') diff --git a/tests/simple_unit/TableGateway/MagicCallTest.php b/tests/simple_unit/TableGateway/MagicCallTest.php new file mode 100644 index 00000000..c0df313d --- /dev/null +++ b/tests/simple_unit/TableGateway/MagicCallTest.php @@ -0,0 +1,31 @@ +add_record1(); $this->add_record2(); + + $result = $this->getGateway()->findByUsername("record2"); + $this->assertEqual($result['username'], 'record2'); + } + + function test_combined_and_or() + { + $this->add_record1(); $this->add_record2(); + + $result = $this->getGateway()->findAllByUsername_OR_phone('Username', '45233')->readAll(); + $this->assertEqual(2, count($result)); + } + + function test_no_result() + { + $this->add_record1(); $this->add_record2(); + $result = $this->getGateway()->findAllByUsername_and_phone('Username', '45233')->readAll(); + + $this->assertEqual(0, count($result)); + } +} +?> \ No newline at end of file -- cgit v1.2.3