public function BambooTwigLoaderTest::testMenu in Bamboo Twig 8
@covers Drupal\bamboo_twig_loaders\TwigExtension\Loader::loadMenu
File
- tests/
src/ Functional/ BambooTwigLoadersTest.php, line 122
Class
- BambooTwigLoaderTest
- Tests Loaders twig filters and functions.
Namespace
Drupal\Tests\bamboo_twig\FunctionalCode
public function testMenu() {
$this
->drupalGet('/bamboo-twig-loaders');
$this
->assertElementPresent('.test-loaders div.loader-menu-no-access');
$this
->assertElementNotPresent('.test-loaders div.loader-menu-no-access ul');
$this
->drupalLogin($this->admin_user);
$this
->drupalGet('/bamboo-twig-loaders');
$this
->assertElementPresent('.test-loaders div.loader-menu-all');
$this
->assertElementCount('ul', 9, '.test-loaders div.loader-menu-all');
$this
->assertElementCount('li', 24, '.test-loaders div.loader-menu-all');
$this
->assertElementPresent('.test-loaders div.loader-menu-level');
$this
->assertElementCount('ul', 8, '.test-loaders div.loader-menu-level');
$this
->assertElementCount('li', 23, '.test-loaders div.loader-menu-level');
$this
->assertElementPresent('.test-loaders div.loader-menu-depth');
$this
->assertElementCount('ul', 2, '.test-loaders div.loader-menu-depth');
$this
->assertElementCount('li', 3, '.test-loaders div.loader-menu-depth');
}