function TourTest::getTourTips

Same name in other branches
  1. 9 core/modules/tour/tests/src/Functional/TourTest.php \Drupal\Tests\tour\Functional\TourTest::getTourTips()
  2. 10 core/modules/tour/tests/src/Functional/TourTest.php \Drupal\Tests\tour\Functional\TourTest::getTourTips()

Gets tour tips from the JavaScript drupalSettings variable.

Return value

array A list of tips and their data.

2 calls to TourTest::getTourTips()
TourTest::findTip in core/modules/tour/tests/src/Functional/TourTest.php
Find specific tips by their parameters in the list of tips.
TourTest::testTourFunctionality in core/modules/tour/tests/src/Functional/TourTest.php
Tests tour functionality.

File

core/modules/tour/tests/src/Functional/TourTest.php, line 275

Class

TourTest
Tests the functionality of tour tips.

Namespace

Drupal\Tests\tour\Functional

Code

protected function getTourTips() {
    $tips = [];
    $drupalSettings = $this->getDrupalSettings();
    if (isset($drupalSettings['_tour_internal'])) {
        foreach ($drupalSettings['_tour_internal'] as $tip) {
            $tips[] = $tip;
        }
    }
    return $tips;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.