updated core to 8.6.1 via composer
This commit is contained in:
@@ -12,6 +12,13 @@ use Drupal\tour\TourInterface;
|
||||
* @ConfigEntityType(
|
||||
* id = "tour",
|
||||
* label = @Translation("Tour"),
|
||||
* label_collection = @Translation("Tours"),
|
||||
* label_singular = @Translation("tour"),
|
||||
* label_plural = @Translation("tours"),
|
||||
* label_count = @PluralTranslation(
|
||||
* singular = "@count tour",
|
||||
* plural = "@count tours",
|
||||
* ),
|
||||
* handlers = {
|
||||
* "view_builder" = "Drupal\tour\TourViewBuilder",
|
||||
* "access" = "Drupal\tour\TourAccessControlHandler",
|
||||
|
||||
@@ -39,6 +39,13 @@ class TipPluginText extends TipPluginBase implements ContainerFactoryPluginInter
|
||||
*/
|
||||
protected $location;
|
||||
|
||||
/**
|
||||
* Unique aria-id.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $ariaId;
|
||||
|
||||
/**
|
||||
* Constructs a \Drupal\tour\Plugin\tour\tip\TipPluginText object.
|
||||
*
|
||||
@@ -70,11 +77,10 @@ class TipPluginText extends TipPluginBase implements ContainerFactoryPluginInter
|
||||
* A unique id to be used to generate aria attributes.
|
||||
*/
|
||||
public function getAriaId() {
|
||||
static $id;
|
||||
if (!isset($id)) {
|
||||
$id = Html::getUniqueId($this->get('id'));
|
||||
if (!$this->ariaId) {
|
||||
$this->ariaId = Html::getUniqueId($this->get('id'));
|
||||
}
|
||||
return $id;
|
||||
return $this->ariaId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\tour\Tests;
|
||||
|
||||
/**
|
||||
* A legacy test for \Drupal\tour\Tests\TourTestBase.
|
||||
*
|
||||
* @group tour
|
||||
*/
|
||||
class TourTest extends TourTestBase {
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = ['block', 'tour', 'locale', 'language', 'tour_test'];
|
||||
|
||||
/**
|
||||
* Tour tip attributes to be tested. Keyed by the path.
|
||||
*
|
||||
* @var array
|
||||
* An array of tip attributes, keyed by path.
|
||||
*/
|
||||
protected $tips = [
|
||||
'tour-test-1' => [
|
||||
'data-id' => 'tour-test-1',
|
||||
'data-class' => 'tour-test-1',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* 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_handler')->install(['bartik', 'seven']);
|
||||
$this->config('system.theme')
|
||||
->set('default', 'bartik')
|
||||
->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);
|
||||
|
||||
$this->drupalPlaceBlock('local_actions_block', [
|
||||
'theme' => 'seven',
|
||||
'region' => 'content'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* A simple tip test.
|
||||
*/
|
||||
public function testTips() {
|
||||
foreach ($this->tips as $path => $attributes) {
|
||||
$this->drupalGet($path);
|
||||
$this->assertTourTips($attributes);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user