3 namespace Drupal\Tests\tour\Functional;
6 * Simple tour tips test base.
8 abstract class TourTestBasic extends TourTestBase {
11 * Tour tip attributes to be tested. Keyed by the path.
14 * An array of tip attributes, keyed by path.
17 * protected $tips = array(
18 * '/foo/bar' => array(
19 * array('data-id' => 'foo'),
20 * array('data-class' => 'bar'),
28 * An admin user with administrative permissions for tour.
30 * @var \Drupal\user\UserInterface
35 * The permissions required for a logged in user to test tour tips.
38 * A list of permissions.
40 protected $permissions = ['access tour'];
42 protected function setUp() {
45 // Make sure we are using distinct default and administrative themes for
46 // the duration of these tests.
47 $this->container->get('theme_handler')->install(['bartik', 'seven']);
48 $this->config('system.theme')
49 ->set('default', 'bartik')
50 ->set('admin', 'seven')
53 $this->permissions[] = 'view the administration theme';
55 // Create an admin user to view tour tips.
56 $this->adminUser = $this->drupalCreateUser($this->permissions);
57 $this->drupalLogin($this->adminUser);
63 public function testTips() {
64 foreach ($this->tips as $path => $attributes) {
65 $this->drupalGet($path);
66 $this->assertTourTips($attributes);