@trigger_error('\Drupal\tour\Tests\TourTestBase is deprecated in 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\tour\Functional\TourTestBase.',E_USER_DEPRECATED);
/**
* Base class for testing Tour functionality.
*
* @deprecated in drupal:8.4.0 and is removed from drupal:9.0.0.
* Use \Drupal\Tests\tour\Functional\TourTestBase instead.
*/
abstractclassTourTestBaseextendsWebTestBase{
/**
* Assert function to determine if tips rendered to the page
* have a corresponding page element.
*
* @code
* // Basic example.
* $this->assertTourTips();
*
* // Advanced example. The following would be used for multipage or
* // targeting a specific subset of tips.
* $tips = array();
* $tips[] = array('data-id' => 'foo');
* $tips[] = array('data-id' => 'bar');
* $tips[] = array('data-class' => 'baz');
* $this->assertTourTips($tips);
* @endcode
*
* @param array $tips
* A list of tips which provide either a "data-id" or "data-class".
*/
publicfunctionassertTourTips($tips=[]){
// Get the rendered tips and their data-id and data-class attributes.
if(empty($tips)){
// Tips are rendered as <li> elements inside <ol id="tour">.
$this->assertTrue(!empty($elements)&&count($elements)===1,newFormattableMarkup('Found corresponding page element for tour tip with id #%data-id',['%data-id'=>$tip['data-id']]));
$this->assertFalse(empty($elements),newFormattableMarkup('Found corresponding page element for tour tip with class .%data-class',['%data-class'=>$tip['data-class']]));
}
else{
// It's a modal.
$modals++;
}
$total++;
}
$this->pass(newFormattableMarkup('Total %total Tips tested of which %modals modal(s).',['%total'=>$total,'%modals'=>$modals]));