You are here

public function DefaultSingleLazyPluginCollectionTest::testGetInstanceIds in Drupal 10

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

@covers ::getInstanceIds

File

core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php, line 65

Class

DefaultSingleLazyPluginCollectionTest
@coversDefaultClass \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection @group Plugin

Namespace

Drupal\Tests\Core\Plugin

Code

public function testGetInstanceIds() {
  $this
    ->setupPluginCollection($this
    ->any());
  $this
    ->assertEquals([
    'apple' => 'apple',
  ], $this->defaultPluginCollection
    ->getInstanceIds());
  $this->defaultPluginCollection
    ->addInstanceId('banana', [
    'id' => 'banana',
    'key' => 'other_value',
  ]);
  $this
    ->assertEquals([
    'banana' => 'banana',
  ], $this->defaultPluginCollection
    ->getInstanceIds());
}