function DefaultSingleLazyPluginCollectionTest::testGetInstanceIds

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php \Drupal\Tests\Core\Plugin\DefaultSingleLazyPluginCollectionTest::testGetInstanceIds()
  2. 10 core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php \Drupal\Tests\Core\Plugin\DefaultSingleLazyPluginCollectionTest::testGetInstanceIds()
  3. 9 core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php \Drupal\Tests\Core\Plugin\DefaultSingleLazyPluginCollectionTest::testGetInstanceIds()
  4. 8.9.x core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php \Drupal\Tests\Core\Plugin\DefaultSingleLazyPluginCollectionTest::testGetInstanceIds()

Tests get instance ids.

File

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

Class

DefaultSingleLazyPluginCollectionTest
Tests Drupal\Core\Plugin\DefaultSingleLazyPluginCollection.

Namespace

Drupal\Tests\Core\Plugin

Code

public function testGetInstanceIds() : void {
  $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());
}

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