function DefaultLazyPluginCollectionTest::testSortHelperException

Tests the sort helper exception if plugin not found.

@legacy-covers ::sortHelper

File

core/tests/Drupal/Tests/Core/Plugin/DefaultLazyPluginCollectionTest.php, line 112

Class

DefaultLazyPluginCollectionTest
Tests Drupal\Core\Plugin\DefaultLazyPluginCollection.

Namespace

Drupal\Tests\Core\Plugin

Code

public function testSortHelperException() : void {
  $this->setupPluginCollection($this->any());
  $this->expectException(PluginNotFoundException::class);
  $this->expectExceptionMessage("Plugin ID 'pear' was not found.");
  $this->defaultPluginCollection
    ->sortHelper("apple", "pear");
}

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