You are here

public function ContextAwarePluginBaseTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginBaseTest.php \Drupal\KernelTests\Core\Plugin\Context\ContextAwarePluginBaseTest::setUp()

Overrides KernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginBaseTest.php, line 35

Class

ContextAwarePluginBaseTest
@coversDefaultClass \Drupal\Core\Plugin\ContextAwarePluginBase

Namespace

Drupal\KernelTests\Core\Plugin\Context

Code

public function setUp() : void {
  parent::setUp();
  $configuration = [
    'context' => [
      'nato_letter' => 'Alpha',
    ],
  ];
  $plugin_definition = new TestPluginDefinition();
  $plugin_definition
    ->addContextDefinition('nato_letter', ContextDefinition::create('string'));
  $this->plugin = $this
    ->getMockBuilder(ContextAwarePluginBase::class)
    ->setConstructorArgs([
    $configuration,
    'the_sisko',
    $plugin_definition,
  ])
    ->setMethods([
    'setContext',
  ])
    ->getMockForAbstractClass();
}