diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php index 0cff49d..8fe78fb 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php @@ -303,6 +303,33 @@ public function testMultipleSearchPages() { } /** + * Test that changing the throttle value is reflected in the config. + */ + function testNodeSearchSettingsForm() { + // This doesn't test the indexing itself, since the form only goes down to + // indexing 10 nodes per batch, and creating and indexing at least 11 nodes + // would be a slow test for the benefit gained. The throttle itself is + // tested by SearchMultilingualEntityTest::testIndexingThrottle(). + + $indexing_throttle = \Drupal::config('search.page.node_search')->get('configuration.cron_limit'); + $this->assertEqual($indexing_throttle, 100, 'Default indexing throttle is 100.'); + + $this->drupalGet('admin/config/search/settings/manage/node_search'); + $this->assertText(t('Number of items to index per cron run')); + + $edit = array( + 'cron_limit' => 50, + ); + $this->drupalPostForm('admin/config/search/settings/manage/node_search', $edit, t('Save search page')); + $this->assertText(t('The Content search page has been updated.')); + + $indexing_throttle = \Drupal::config('search.page.node_search')->get('configuration.cron_limit'); + $this->assertEqual($indexing_throttle, 50, 'Indexing throttle is now 50.'); + + // Content ranking settings are tested by SearchRankingTest + } + + /** * Checks that the search page operations match expectations. * * @param string $id