mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed SearchFilterApplyRelationTest not to assume ID ordering in the assertions, which breaks with databases not ordering by PK automatically (e.g. Postgres)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87926 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
8a4f2f2bf0
commit
277bffb664
@ -28,6 +28,9 @@ class SearchFilterApplyRelationTest extends SapphireTest{
|
||||
}
|
||||
|
||||
function testApplyRelationHasMany(){
|
||||
$do1 = $this->objFromFixture('SearchFilterApplyRelationTest_DO', 'do1');
|
||||
$do2 = $this->objFromFixture('SearchFilterApplyRelationTest_DO', 'do2');
|
||||
|
||||
$all = singleton("SearchFilterApplyRelationTest_DO");
|
||||
$context = $all->getDefaultSearchContext();
|
||||
|
||||
@ -39,14 +42,14 @@ class SearchFilterApplyRelationTest extends SapphireTest{
|
||||
);
|
||||
$results = $context->getResults($params);
|
||||
$this->assertEquals(1, $results->count());
|
||||
$this->assertEquals(array('1'), $results->column('ID'));
|
||||
$this->assertEquals(array($do1->ID), $results->column('ID'));
|
||||
|
||||
$params = array(
|
||||
"SearchFilterApplyRelationTest_HasManyGrantChildren__Title" => "I am has_many object3",
|
||||
);
|
||||
$results = $context->getResults($params);
|
||||
$this->assertEquals(1, $results->count());
|
||||
$this->assertEquals(array('2'), $results->column('ID'));
|
||||
$this->assertEquals(array($do2->ID), $results->column('ID'));
|
||||
|
||||
$params = array(
|
||||
"SearchFilterApplyRelationTest_HasManyGrantChildren__Title" => "I am has_many object",
|
||||
|
Loading…
x
Reference in New Issue
Block a user