Merge pull request #10434 from creative-commoners/pulls/4/fix-test

MNT Fix broken unit test
This commit is contained in:
Guy Sartorelli 2022-08-03 16:06:50 +12:00 committed by GitHub
commit 9b1052f955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,7 +168,9 @@ class GridFieldFilterHeaderTest extends SapphireTest
public function testCustomSearchField()
{
$searchSchema = json_decode($this->component->getSearchFieldSchema($this->gridField));
$this->assertEquals('Name', $searchSchema->name);
$modelClass = $this->gridField->getModelClass();
$obj = new $modelClass();
$this->assertEquals($obj->getGeneralSearchFieldName(), $searchSchema->name);
Config::modify()->set(Team::class, 'general_search_field', 'CustomSearch');
$searchSchema = json_decode($this->component->getSearchFieldSchema($this->gridField));