From: Pierre Habouzit (MadCoder Date: Mon, 13 Dec 2004 16:32:55 +0000 (+0000) Subject: damnit X-Git-Tag: xorg/old~661 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=bb7f3184966be950de07f779cbaa6538d288fd23;p=platal.git damnit git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-87 --- diff --git a/htdocs/TESTS/xorg_lists.php b/htdocs/TESTS/xorg_lists.php new file mode 100644 index 0000000..1d3dbd1 --- /dev/null +++ b/htdocs/TESTS/xorg_lists.php @@ -0,0 +1,47 @@ +UnitTestCase('List functions'); + } + + function test_list_sort_owners() { + $l1 = Array('xavier.merlin.1998@polytechnique.org', + 'xavier.merlin.1991@polytechnique.org', + 'pierre.habouzit.2000@polytechnique.org', + 'yann.chevalier.2000@polytechnique.org', + 'foobar@baz.org'); + + $t = list_sort_owners($l1); + $this->assertIdentical($t[0][0]['l'], 'foobar@baz.org'); + + $t1991 = array_values($t[1991]); + $this->assertIdentical($t1991[0]['l'], 'xavier.merlin.1991'); + + $t1998 = array_values($t[1998]); + $this->assertIdentical($t1998[0]['l'], 'xavier.merlin.1998'); + + $t2000 = array_values($t[2000]); + $this->assertIdentical($t2000[0]['l'], 'yann.chevalier.2000'); + $this->assertIdentical($t2000[1]['l'], 'pierre.habouzit.2000'); + + $t = list_sort_owners($l1, false); + $this->assertIdentical($t[0][0]['l'], 'foobar@baz.org'); + + $tC = array_values($t['C']); + $this->assertIdentical($tC[0]['l'], 'yann.chevalier.2000'); + + $tH = array_values($t['H']); + $this->assertIdentical($tH[0]['l'], 'pierre.habouzit.2000'); + + $tM = array_values($t['M']); + $this->assertIdentical($tM[0]['l'], 'xavier.merlin.1991'); + $this->assertIdentical($tM[1]['l'], 'xavier.merlin.1998'); + } +} + +$test = &new TestOfList(); +$test->run($reporter); +?>