function DevelLayoutInfoTest::testLayoutDiscoveryDependency

Same name in other branches
  1. 4.x tests/src/Functional/DevelLayoutInfoTest.php \Drupal\Tests\devel\Functional\DevelLayoutInfoTest::testLayoutDiscoveryDependency()

Tests the dependency with layout_discovery module.

File

tests/src/Functional/DevelLayoutInfoTest.php, line 119

Class

DevelLayoutInfoTest
Tests layout info pages and links.

Namespace

Drupal\Tests\devel\Functional

Code

public function testLayoutDiscoveryDependency() : void {
    $this->container
        ->get('module_installer')
        ->uninstall([
        'layout_discovery',
    ]);
    $this->drupalPlaceBlock('system_menu_block:devel');
    // Ensures that the layout info link is not present on the devel menu.
    $this->drupalGet('');
    $this->assertSession()
        ->linkNotExists('Layouts Info');
    // Ensures that the layouts info page is not available.
    $this->drupalGet('/devel/layouts');
    $this->assertSession()
        ->statusCodeEquals(404);
    // Check a few other devel pages to verify devel module stil works.
    $this->drupalGet('/devel/events');
    $this->assertSession()
        ->statusCodeEquals(200);
    $this->drupalGet('devel/routes');
    $this->assertSession()
        ->statusCodeEquals(200);
    $this->drupalGet('/devel/container/service');
    $this->assertSession()
        ->statusCodeEquals(200);
}