function LayoutPluginManagerTest::testProcessDefinition

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

Tests process definition.

File

core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php, line 267

Class

LayoutPluginManagerTest
Tests Drupal\Core\Layout\LayoutPluginManager.

Namespace

Drupal\Tests\Core\Layout

Code

public function testProcessDefinition() : void {
  $this->moduleHandler
    ->alter('layout', Argument::type('array'))
    ->shouldNotBeCalled();
  $this->expectException(InvalidPluginDefinitionException::class);
  $this->expectExceptionMessage('The "module_a_derived_layout:array_based" layout definition must extend ' . LayoutDefinition::class);
  $module_a_provided_layout = <<<'EOS'
  module_a_derived_layout:
    deriver: \Drupal\Tests\Core\Layout\LayoutDeriver
    array_based: true
  EOS;
  vfsStream::create([
    'modules' => [
      'module_a' => [
        'module_a.layouts.yml' => $module_a_provided_layout,
      ],
    ],
  ]);
  $this->layoutPluginManager
    ->getDefinitions();
}

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