function BlockManagerTest::testHandlePluginNotFound

Tests handle plugin not found.

@legacy-covers ::handlePluginNotFound

File

core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php, line 123

Class

BlockManagerTest
Tests Drupal\Core\Block\BlockManager.

Namespace

Drupal\Tests\Core\Block

Code

public function testHandlePluginNotFound() : void {
  $this->logger
    ->warning('The "%plugin_id" block plugin was not found', [
    '%plugin_id' => 'invalid',
  ])
    ->shouldBeCalled();
  $plugin = $this->blockManager
    ->createInstance('invalid');
  $this->assertSame('broken', $plugin->getPluginId());
}

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