From 27d2f75d9dc9e7ae7872c1cacf83f363f302e114 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 15 Jan 2013 01:11:35 +0100 Subject: [PATCH] Added test for DataList filters with array and modifiers (see #8162) --- tests/model/DataListTest.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/model/DataListTest.php b/tests/model/DataListTest.php index 385fb9ea9..6978c100c 100644 --- a/tests/model/DataListTest.php +++ b/tests/model/DataListTest.php @@ -439,7 +439,7 @@ class DataListTest extends SapphireTest { $list = $list->filter(array('Name'=>'Bob', 'Comment'=>'Phil is a unique guy, and comments on team2')); $this->assertEquals(0, $list->count()); } - + /** * $list->filter(array('Name'=>'bob, 'Age'=>21)); // bob with the age 21 */ @@ -465,6 +465,15 @@ class DataListTest extends SapphireTest { $this->assertEquals('Bob', $list->first()->Name, 'First comment should be from Bob'); $this->assertEquals('Phil', $list->last()->Name, 'Last comment should be from Phil'); } + + public function testFilterMultipleWithArrayFilterAndModifiers() { + $list = DataObjectTest_TeamComment::get(); + $list = $list->filter(array('Name:StartsWith'=>array('Bo', 'Jo'))); + $list = $list->sort('Name', 'ASC'); + $this->assertEquals(2, $list->count()); + $this->assertEquals('Bob', $list->first()->Name); + $this->assertEquals('Joe', $list->last()->Name); + } /** * $list->filter(array('Name'=>array('aziz','bob'), 'Age'=>array(21, 43)));