responsive_menu-4.4.1/tests/src/Functional/ResponsiveMenuHooks.php
tests/src/Functional/ResponsiveMenuHooks.php
<?php
namespace Drupal\Tests\responsive_menu\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Class ResponsiveMenuHooks.
*
* @package Drupal\Tests\responsive_menu\Functional
*
* @group responsive_menu
*/
class ResponsiveMenuHooks extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = ['responsive_menu_test'];
/**
* {@inheritdoc}
*/
protected $profile = 'minimal';
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Permissions for user that will be logged-in for test.
*
* @var array
*/
protected static $userPermissions = [
'access content',
'administer site configuration',
];
/**
* {@inheritdoc}
*
* @throws \Drupal\Core\Entity\EntityStorageException
*/
protected function setUp(): void {
parent::setUp();
$account = $this->drupalCreateUser(static::$userPermissions);
$this->drupalLogin($account);
}
/**
* Tests that hook_responsive_menu_off_canvas_output_alter works.
*
* When using starterkit_theme as the theme the hook should trigger and
* disable the module output in page_bottom.
*/
public function testWarningWithNoBreakpoints() {
\Drupal::service('theme_installer')->install(['starterkit_theme']);
\Drupal::configFactory()->getEditable('system.theme')->set('default', 'starterkit_theme')->save();
$this->drupalGet('/node/1');
$this->assertSession()->elementNotExists('css', '#off-canvas-wrapper');
}
}
