class TourTestBasic
Simple tour tips test base.
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\tour\Functional\TourTestBase implements \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\tour\Functional\TourTestBasic implements \Drupal\Tests\tour\Functional\TourTestBase
- class \Drupal\Tests\tour\Functional\TourTestBase implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of TourTestBasic
File
-
core/
modules/ tour/ tests/ src/ Functional/ TourTestBasic.php, line 8
Namespace
Drupal\Tests\tour\FunctionalView source
abstract class TourTestBasic extends TourTestBase {
/**
* Tour tip attributes to be tested. Keyed by the path.
*
* @var array
* An array of tip attributes, keyed by path.
*
* @code
* protected $tips = array(
* '/foo/bar' => array(
* array('data-id' => 'foo'),
* array('data-class' => 'bar'),
* ),
* );
* @endcode
*/
protected $tips = [];
/**
* An admin user with administrative permissions for tour.
*
* @var \Drupal\user\UserInterface
*/
protected $adminUser;
/**
* The permissions required for a logged in user to test tour tips.
*
* @var array
* A list of permissions.
*/
protected $permissions = [
'access tour',
];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
// Make sure we are using distinct default and administrative themes for
// the duration of these tests.
$this->container
->get('theme_installer')
->install([
'olivero',
'claro',
]);
$this->config('system.theme')
->set('default', 'olivero')
->set('admin', 'claro')
->save();
$this->permissions[] = 'view the administration theme';
// Create an admin user to view tour tips.
$this->adminUser = $this->drupalCreateUser($this->permissions);
$this->drupalLogin($this->adminUser);
}
/**
* A simple tip test.
*/
public function testTips() {
foreach ($this->tips as $path => $attributes) {
$this->drupalGet($path);
$this->assertTourTips($attributes);
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.