diff --git a/core/modules/tour/lib/Drupal/tour/Tests/TourTestBasic.php b/core/modules/tour/lib/Drupal/tour/Tests/TourTestBasic.php index c600a7f..9d2d5e3 100644 --- a/core/modules/tour/lib/Drupal/tour/Tests/TourTestBasic.php +++ b/core/modules/tour/lib/Drupal/tour/Tests/TourTestBasic.php @@ -48,6 +48,20 @@ protected function setUp() { parent::setUp(); + + // Make sure we are using distinct default and administrative themes for + // the duration of these tests. + $this->container->get('config.factory') + ->get('system.theme') + ->set('default', 'bartik') + ->save(); + theme_enable(array('seven')); + $this->container->get('config.factory') + ->get('system.theme') + ->set('admin', 'seven') + ->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); diff --git a/core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml b/core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml index 8da1586..3fa6d5c 100644 --- a/core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml +++ b/core/modules/tour/tests/tour_test/config/tour.tour.tour-test.yml @@ -13,6 +13,14 @@ tips: weight: "1" attributes: data-id: tour-test-1 + tour-test-action: + id: tour-test-3 + plugin: text + label: The action + body: The action button of awesome + weight: "2" + attributes: + data-class: button-action tour-test-3: id: tour-test-3 plugin: image diff --git a/core/modules/tour/tests/tour_test/tour_test.local_actions.yml b/core/modules/tour/tests/tour_test/tour_test.local_actions.yml new file mode 100644 index 0000000..b39fb2a --- /dev/null +++ b/core/modules/tour/tests/tour_test/tour_test.local_actions.yml @@ -0,0 +1,5 @@ +tour_test_action: + route_name: tour_test_1_action + title: 'Tour test action' + appears_on: + - tour_test_1 diff --git a/core/modules/tour/tests/tour_test/tour_test.module b/core/modules/tour/tests/tour_test/tour_test.module index 493b878..c6a6a67 100644 --- a/core/modules/tour/tests/tour_test/tour_test.module +++ b/core/modules/tour/tests/tour_test/tour_test.module @@ -8,6 +8,16 @@ use Drupal\Core\Entity\EntityInterface; /** + * Implements hook_admin_paths(). + */ +function tour_test_admin_paths() { + $paths = array( + 'tour-test-1' => TRUE, + ); + return $paths; +} + +/** * Implements hook_menu(). */ function tour_test_menu() { diff --git a/core/modules/tour/tests/tour_test/tour_test.routing.yml b/core/modules/tour/tests/tour_test/tour_test.routing.yml index 2cdad99..e1a68b6 100644 --- a/core/modules/tour/tests/tour_test/tour_test.routing.yml +++ b/core/modules/tour/tests/tour_test/tour_test.routing.yml @@ -5,6 +5,13 @@ tour_test_1: requirements: _access: 'TRUE' +tour_test_1_action: + pattern : 'tour-test-1/action' + defaults: + _content: '\Drupal\tour_test\Controller\TourTestController::tourTest1' + requirements: + _access: 'TRUE' + tour_test_2: pattern : 'tour-test-2/subpath' defaults: