function SearchConfigSettingsFormTest::testRouteProtection
Same name in other branches
- 8.9.x core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php \Drupal\Tests\search\Functional\SearchConfigSettingsFormTest::testRouteProtection()
- 10 core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php \Drupal\Tests\search\Functional\SearchConfigSettingsFormTest::testRouteProtection()
- 11.x core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php \Drupal\Tests\search\Functional\SearchConfigSettingsFormTest::testRouteProtection()
Tests that the enable/disable/default routes are protected from CSRF.
File
-
core/
modules/ search/ tests/ src/ Functional/ SearchConfigSettingsFormTest.php, line 361
Class
- SearchConfigSettingsFormTest
- Verify the search config settings form.
Namespace
Drupal\Tests\search\FunctionalCode
public function testRouteProtection() {
// Ensure that the enable and disable routes are protected.
$this->drupalGet('admin/config/search/pages/manage/node_search/enable');
$this->assertSession()
->statusCodeEquals(403);
$this->drupalGet('admin/config/search/pages/manage/node_search/disable');
$this->assertSession()
->statusCodeEquals(403);
$this->drupalGet('admin/config/search/pages/manage/node_search/set-default');
$this->assertSession()
->statusCodeEquals(403);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.