function DefaultsSectionStorageTest::testBuildRoutesNoFieldUi

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/tests/src/Unit/DefaultsSectionStorageTest.php \Drupal\Tests\layout_builder\Unit\DefaultsSectionStorageTest::testBuildRoutesNoFieldUi()
  2. 10 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 <a href="/api/drupal/core%21modules%21layout_builder%21src%21Plugin%21SectionStorage%21DefaultsSectionStorage.php/class/DefaultsSectionStorage/11.x" title="Defines the &#039;defaults&#039; section storage type." class="local">\Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage</a>

Namespace

Drupal\Tests\layout_builder\Unit

Code

public function testBuildRoutesNoFieldUi() : void {
    $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.