← Back to team overview

anewt-developers team mailing list archive

[Branch ~uws/anewt/anewt.uws] Rev 1706: [autorecord] More tests

 

------------------------------------------------------------
revno: 1706
committer: Wouter Bolsterlee <uws@xxxxxxxxx>
branch nick: anewt.uws
timestamp: Tue 2009-07-21 21:19:40 +0200
message:
  [autorecord] More tests
modified:
  autorecord/autorecord.test.php

=== modified file 'autorecord/autorecord.test.php'
--- autorecord/autorecord.test.php	2009-07-18 16:52:08 +0000
+++ autorecord/autorecord.test.php	2009-07-21 19:19:40 +0000
@@ -169,9 +169,20 @@
 	function test_grouping()
 	{
 		$all_records = Person::db_find_all();
+
 		$list = Person::array_by_column_value($all_records, 'name', true);
+		$this->assertTrue($list['Foo'] instanceof Person);
+		$this->assertEquals(6, count($list));
+
 		$list = Person::array_by_column_value($all_records, 'name', false);
+		$this->assertTrue(is_array($list['Foo']));
+		$this->assertEquals(6, count($list));
+		$this->assertTrue($list['Foo'][0] instanceof Person);
+
 		$list = Person::array_by_primary_key_value($all_records);
+		$this->assertTrue($list[1] instanceof Person);
+		$this->assertEquals(6, count($list));
+		$this->assertFalse(array_has_key($list, 7));
 	}
 
 	function test_dump()



--
lp:anewt
https://code.launchpad.net/~uws/anewt/anewt.uws

Your team Anewt developers is subscribed to branch lp:anewt.
To unsubscribe from this branch go to https://code.launchpad.net/~uws/anewt/anewt.uws/+edit-subscription.