You are here

protected function DefaultPluginManagerTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php \Drupal\Tests\Core\Plugin\DefaultPluginManagerTest::setUp()
  2. 9 core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php \Drupal\Tests\Core\Plugin\DefaultPluginManagerTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php, line 39

Class

DefaultPluginManagerTest
Tests the DefaultPluginManager.

Namespace

Drupal\Tests\Core\Plugin

Code

protected function setUp() : void {
  $this->expectedDefinitions = [
    'apple' => [
      'id' => 'apple',
      'label' => 'Apple',
      'color' => 'green',
      'class' => 'Drupal\\plugin_test\\Plugin\\plugin_test\\fruit\\Apple',
    ],
    'banana' => [
      'id' => 'banana',
      'label' => 'Banana',
      'color' => 'yellow',
      'uses' => [
        'bread' => 'Banana bread',
        'loaf' => [
          'singular' => '@count loaf',
          'plural' => '@count loaves',
        ],
      ],
      'class' => 'Drupal\\plugin_test\\Plugin\\plugin_test\\fruit\\Banana',
    ],
  ];
  $this->namespaces = new \ArrayObject();
  $this->namespaces['Drupal\\plugin_test'] = $this->root . '/core/modules/system/tests/modules/plugin_test/src';
}