mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Added test for DataList filters with array and modifiers (see #8162)
This commit is contained in:
parent
a93f8841d7
commit
27d2f75d9d
@ -466,6 +466,15 @@ class DataListTest extends SapphireTest {
|
||||
$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)));
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user