From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- tests/unit/SQLMap/DelegateTest.php | 126 ++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 63 deletions(-) (limited to 'tests/unit/SQLMap/DelegateTest.php') diff --git a/tests/unit/SQLMap/DelegateTest.php b/tests/unit/SQLMap/DelegateTest.php index e4c4d812..cd285d98 100644 --- a/tests/unit/SQLMap/DelegateTest.php +++ b/tests/unit/SQLMap/DelegateTest.php @@ -1,64 +1,64 @@ -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); - } -} - - - +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 -- cgit v1.2.3