function DefaultsSectionStorageTest::testBuildRoutesNoFieldUi

Same name in other branches
  1. 10 core/modules/layout_builder/tests/src/Unit/DefaultsSectionStorageTest.php \Drupal\Tests\layout_builder\Unit\DefaultsSectionStorageTest::testBuildRoutesNoFieldUi()
  2. 11.x core/modules/layout_builder/tests/src/Unit/DefaultsSectionStorageTest.php \Drupal\Tests\layout_builder\Unit\DefaultsSectionStorageTest::testBuildRoutesNoFieldUi()

@covers ::buildRoutes

File

core/modules/layout_builder/tests/src/Unit/DefaultsSectionStorageTest.php, line 418

Class

DefaultsSectionStorageTest
@coversDefaultClass \Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage

Namespace

Drupal\Tests\layout_builder\Unit

Code

public function testBuildRoutesNoFieldUi() {
    $module_handler = $this->prophesize(ModuleHandlerInterface::class);
    $module_handler->moduleExists('field_ui')
        ->willReturn(FALSE);
    $container = new ContainerBuilder();
    $container->set('module_handler', $module_handler->reveal());
    \Drupal::setContainer($container);
    $collection = new RouteCollection();
    $this->plugin
        ->buildRoutes($collection);
    $this->assertEmpty($collection->all());
}

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