TEST filterAny on many_many relations return correct items

This commit is contained in:
Daniel Hensby 2017-11-16 11:09:57 +00:00
parent ef86b16854
commit 4f3deb13e0
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E

View File

@ -774,6 +774,15 @@ class DataListTest extends SapphireTest {
$this->assertEquals(1, $list->count());
}
public function testFilterAnyWithRelation() {
$list = DataObjectTest_Player::get();
$list = $list->filterAny(array(
'Teams.Title:StartsWith' => 'Team',
'ID:GreaterThan' => 0,
));
$this->assertCount(4, $list);
}
public function testFilterAnyMultipleArray() {
$list = DataObjectTest_TeamComment::get();
$list = $list->filterAny(array('Name'=>'Bob', 'Comment'=>'This is a team comment by Bob'));