function BlockManagerTest::testHandlePluginNotFound

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php \Drupal\Tests\Core\Block\BlockManagerTest::testHandlePluginNotFound()
  2. 8.9.x core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php \Drupal\Tests\Core\Block\BlockManagerTest::testHandlePluginNotFound()
  3. 11.x core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php \Drupal\Tests\Core\Block\BlockManagerTest::testHandlePluginNotFound()

@covers ::handlePluginNotFound

File

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

Class

BlockManagerTest
@coversDefaultClass \Drupal\Core\Block\BlockManager[[api-linebreak]]

Namespace

Drupal\Tests\Core\Block

Code

public function testHandlePluginNotFound() : void {
  $this->logger
    ->warning('The "%plugin_id" 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.