function ActionValidationTest::testInvalidPluginId

Same name and namespace in other branches
  1. 10 core/modules/system/tests/src/Kernel/Entity/ActionValidationTest.php \Drupal\Tests\system\Kernel\Entity\ActionValidationTest::testInvalidPluginId()

Tests that the action plugin ID is validated.

File

core/modules/system/tests/src/Kernel/Entity/ActionValidationTest.php, line 49

Class

ActionValidationTest
Tests validation of action entities.

Namespace

Drupal\Tests\system\Kernel\Entity

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.