function PluginExistsConstraintTest::testMissingOption

Same name in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Plugin/PluginExistsConstraintTest.php \Drupal\Tests\Core\Plugin\PluginExistsConstraintTest::testMissingOption()

Tests missing option.

@covers ::create

File

core/tests/Drupal/Tests/Core/Plugin/PluginExistsConstraintTest.php, line 26

Class

PluginExistsConstraintTest
@group Plugin @group Validation

Namespace

Drupal\Tests\Core\Plugin

Code

public function testMissingOption() : void {
    $this->expectException(MissingOptionsException::class);
    $this->expectExceptionMessage('The option "manager" must be set for constraint "Drupal\\Core\\Plugin\\Plugin\\Validation\\Constraint\\PluginExistsConstraint".');
    $container = $this->createMock(ContainerInterface::class);
    PluginExistsConstraint::create($container, [], 'test_plugin_id', []);
}

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