function SearchPageValidationTest::testInvalidPluginId

Same name in other branches
  1. 11.x core/modules/search/tests/src/Kernel/SearchPageValidationTest.php \Drupal\Tests\search\Kernel\SearchPageValidationTest::testInvalidPluginId()

Tests that the search plugin ID is validated.

File

core/modules/search/tests/src/Kernel/SearchPageValidationTest.php, line 42

Class

SearchPageValidationTest
Tests validation of search_page entities.

Namespace

Drupal\Tests\search\Kernel

Code

public function testInvalidPluginId() : void {
    $this->entity
        ->set('plugin', 'non_existent');
    $this->assertValidationErrors([
        'plugin' => "The 'non_existent' plugin does not exist.",
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.