diff options
author | ctrlaltca <> | 2012-11-18 20:26:25 +0000 |
---|---|---|
committer | ctrlaltca <> | 2012-11-18 20:26:25 +0000 |
commit | 43233000543984eda49768edde65076fb9c2468c (patch) | |
tree | 48578b1c5485c1f3342796cf7efa024882efd726 /tests/unit/SQLMap/DelegateTest.php | |
parent | 6dff17fee04f8b8a1f35ec8e9afe65ae32b2684c (diff) |
dropped old tests referring to unexisting components (NOTE: this includes what seems a test suite for an older version of SQLMap)
Diffstat (limited to 'tests/unit/SQLMap/DelegateTest.php')
-rw-r--r-- | tests/unit/SQLMap/DelegateTest.php | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/tests/unit/SQLMap/DelegateTest.php b/tests/unit/SQLMap/DelegateTest.php deleted file mode 100644 index cd285d98..00000000 --- a/tests/unit/SQLMap/DelegateTest.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -require_once(dirname(__FILE__).'/BaseTest.php'); - -/** - * @package System.DataAccess.SQLMap - */ -class DelegateTest extends BaseTest -{ - function __construct() - { - parent::__construct(); - $this->initSqlMap(); - } - - function testListDelegate() - { - $list = $this->sqlmap->queryWithRowDelegate( - "GetAllAccountsViaResultMap", array($this, 'listHandler')); - - $this->assertEquals(5, count($list)); - $this->assertAccount1($list[0]); - $this->assertEquals(1, $list[0]->getID()); - $this->assertEquals(2, $list[1]->getID()); - $this->assertEquals(3, $list[2]->getID()); - $this->assertEquals(4, $list[3]->getID()); - $this->assertEquals(5, $list[4]->getID()); - } - - /** - * Test ExecuteQueryForMap : Hashtable. - */ - function testExecuteQueryForMap() - { - $map = $this->sqlmap->QueryForMapWithRowDelegate( - "GetAllAccountsViaResultClass", array($this, 'mapHandler'), null, "FirstName"); - - $this->assertEquals(5, count($map)); - $this->assertAccount1($map["Joe"]); - - $this->assertEquals(1, $map["Joe"]->getID()); - $this->assertEquals(2, $map["Averel"]->getID()); - $this->assertEquals(3, $map["William"]->getID()); - $this->assertEquals(4, $map["Jack"]->getID()); - $this->assertEquals(5, $map["Gilles"]->getID()); - } - - public function listHandler($sender, $param) - { - $list = &$param->getList(); - $list[] = $param->result; - $this->assertTrue($param->result instanceof Account); - } - - public function mapHandler($sender, $param) - { - $map = &$param->getMap(); - $map[$param->getKey()] = $param->getValue(); - $this->assertTrue($param->getValue() instanceof Account); - } -} - - - -?>
\ No newline at end of file |