diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index a6f4a063435..00000000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,17 +0,0 @@ - -inherit: true - -build: - environment: - variables: - # Must match actual branch, not alias. E.g. 4.x-dev rather than 4.1.x-dev for 4 branch, but 4.0.x-dev for 4.0 branch - COMPOSER_ROOT_VERSION: 4.x-dev - nodes: - analysis: - tests: - override: [php-scrutinizer-run] - -filter: - paths: - - src/* - - tests/* diff --git a/src/Forms/GridField/GridFieldFilterHeader.php b/src/Forms/GridField/GridFieldFilterHeader.php index d0077fffdc9..43e781a9cd3 100755 --- a/src/Forms/GridField/GridFieldFilterHeader.php +++ b/src/Forms/GridField/GridFieldFilterHeader.php @@ -362,7 +362,7 @@ public function getSearchForm(GridField $gridField) } foreach ($searchFields->getIterator() as $field) { - $field->addExtraClass('stacked'); + $field->addExtraClass('stacked no-change-track'); } $name = $gridField->Title ?: singleton($gridField->getModelClass())->i18n_plural_name(); diff --git a/tests/php/Forms/GridField/GridFieldFilterHeaderTest.php b/tests/php/Forms/GridField/GridFieldFilterHeaderTest.php index 2c721927dc5..e7bf6a3fbbb 100644 --- a/tests/php/Forms/GridField/GridFieldFilterHeaderTest.php +++ b/tests/php/Forms/GridField/GridFieldFilterHeaderTest.php @@ -139,4 +139,21 @@ public function testHandleActionReset() 'GridFieldFilterHeader::handleAction resets the gridstate filter when the user resets the search.' ); } + + public function testGetSearchForm() + { + $searchForm = $this->component->getSearchForm($this->gridField); + + $this->assertTrue($searchForm instanceof Form); + $this->assertEquals('Search__Name', $searchForm->fields[0]->Name); + $this->assertEquals('Search__City', $searchForm->fields[1]->Name); + $this->assertEquals('Search__Cheerleader__Hat__Colour', $searchForm->fields[2]->Name); + $this->assertEquals('TeamsSearchForm', $searchForm->Name); + $this->assertEquals('cms-search-form', $searchForm->extraClasses['cms-search-form']); + + foreach ($searchForm->fields as $field) { + $this->assertEquals('stacked', $field->extraClasses['stacked']); + $this->assertEquals('no-change-track', $field->extraClasses['no-change-track']); + } + } }