mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed SearchFilterApplyRelationTest to match new SearchContext->addFilter() API: Needs the full name including relation instead of the ambiguous stripped name. This matches DataObject->scaffoldSearchFields() and getDefaultSearchContext()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@86414 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
dc459efbdb
commit
0b02436943
@ -35,27 +35,27 @@ class SearchFilterApplyRelationTest extends SapphireTest{
|
||||
$context->setFilters(null);
|
||||
$context->addFilter($filter);
|
||||
$params = array(
|
||||
"Title" => "I am has_many object1",
|
||||
"SearchFilterApplyRelationTest_HasManyGrantChildren__Title" => "I am has_many object1",
|
||||
);
|
||||
$results = $context->getResults($params);
|
||||
$this->assertEquals(1, $results->count());
|
||||
$this->assertEquals(array('1'), $results->column('ID'));
|
||||
|
||||
$params = array(
|
||||
"Title" => "I am has_many object3",
|
||||
"SearchFilterApplyRelationTest_HasManyGrantChildren__Title" => "I am has_many object3",
|
||||
);
|
||||
$results = $context->getResults($params);
|
||||
$this->assertEquals(1, $results->count());
|
||||
$this->assertEquals(array('2'), $results->column('ID'));
|
||||
|
||||
$params = array(
|
||||
"Title" => "I am has_many object",
|
||||
"SearchFilterApplyRelationTest_HasManyGrantChildren__Title" => "I am has_many object",
|
||||
);
|
||||
$results = $context->getResults($params);
|
||||
$this->assertEquals(2, $results->count());
|
||||
|
||||
$params = array(
|
||||
"Title" => "not exist",
|
||||
"SearchFilterApplyRelationTest_HasManyGrantChildren__Title" => "not exist",
|
||||
);
|
||||
$results = $context->getResults($params);
|
||||
$this->assertEquals(0, $results->count());
|
||||
@ -69,25 +69,25 @@ class SearchFilterApplyRelationTest extends SapphireTest{
|
||||
$context->setFilters(null);
|
||||
$context->addFilter($filter);
|
||||
$params = array(
|
||||
"Title" => "I am many_many object1",
|
||||
"ManyManyGrantChildren__Title" => "I am many_many object1",
|
||||
);
|
||||
$results = $context->getResults($params);
|
||||
$this->assertEquals(2, $results->count());
|
||||
|
||||
$params = array(
|
||||
"Title" => "I am many_many object2",
|
||||
"ManyManyGrantChildren__Title" => "I am many_many object2",
|
||||
);
|
||||
$results = $context->getResults($params);
|
||||
$this->assertEquals(2, $results->count());
|
||||
|
||||
$params = array(
|
||||
"Title" => "I am many_many object",
|
||||
"ManyManyGrantChildren__Title" => "I am many_many object",
|
||||
);
|
||||
$results = $context->getResults($params);
|
||||
$this->assertEquals(2, $results->count());
|
||||
|
||||
$params = array(
|
||||
"Title" => "not exist",
|
||||
"ManyManyGrantChildren__Title" => "not exist",
|
||||
);
|
||||
$results = $context->getResults($params);
|
||||
$this->assertEquals(0, $results->count());
|
||||
|
Loading…
x
Reference in New Issue
Block a user