ResponsiveMenuTest.php in Responsive and off-canvas menu 4.4.x
File
tests/src/Functional/ResponsiveMenuTest.php
View source
<?php
namespace Drupal\Tests\responsive_menu\Functional;
use Drupal\Tests\BrowserTestBase;
class ResponsiveMenuTest extends BrowserTestBase {
protected static $modules = [
'responsive_menu_test',
];
protected $profile = 'minimal';
protected $defaultTheme = 'stark';
protected static $userPermissions = [
'access content',
];
protected function setUp() : void {
parent::setUp();
$account = $this
->drupalCreateUser(static::$userPermissions);
$this
->drupalLogin($account);
}
public function testExistenceOfTestContent() {
$this
->drupalGet('/node/3');
$this
->assertSession()
->statusCodeEquals(200);
}
public function testExistenceOfHorizontalMenu() {
$this
->drupalGet('/node/3');
$this
->assertSession()
->elementContains('css', '.responsive-menu-block-wrapper', 'Menu item without children');
}
}