updated core and modules

This commit is contained in:
Bachir Soussi Chiadmi
2017-09-09 16:27:51 +02:00
parent 027aa99b32
commit 41863f872c
7810 changed files with 318922 additions and 83631 deletions
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# Information added by Drupal.org packaging script on 2016-08-03
version: '8.1.8'
# Information added by Drupal.org packaging script on 2017-08-16
version: '8.3.7'
core: '8.x'
project: 'drupal'
datestamp: 1470233791
datestamp: 1502903957
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# Information added by Drupal.org packaging script on 2016-08-03
version: '8.1.8'
# Information added by Drupal.org packaging script on 2017-08-16
version: '8.3.7'
core: '8.x'
project: 'drupal'
datestamp: 1470233791
datestamp: 1502903957
@@ -12,38 +12,38 @@ use Drupal\Core\Url;
*/
function toolbar_test_toolbar() {
$items['testing'] = array(
$items['testing'] = [
'#type' => 'toolbar_item',
'tab' => array(
'tab' => [
'#type' => 'link',
'#title' => t('Test tab'),
'#url' => Url::fromRoute('<front>'),
'#options' => array(
'attributes' => array(
'#options' => [
'attributes' => [
'id' => 'toolbar-tab-testing',
'title' => t('Test tab'),
),
),
),
'tray' => array(
],
],
],
'tray' => [
'#heading' => t('Test tray'),
'#wrapper_attributes' => array(
'#wrapper_attributes' => [
'id' => 'toolbar-tray-testing',
),
'content' => array(
],
'content' => [
'#theme' => 'item_list',
'#items' => array(
\Drupal::l(t('link 1'), new Url('<front>', [], array('attributes' => array('title' => 'Test link 1 title')))),
\Drupal::l(t('link 2'), new Url('<front>', [], array('attributes' => array('title' => 'Test link 2 title')))),
\Drupal::l(t('link 3'), new Url('<front>', [], array('attributes' => array('title' => 'Test link 3 title')))),
),
'#attributes' => array(
'class' => array('toolbar-menu'),
),
),
),
'#items' => [
\Drupal::l(t('link 1'), new Url('<front>', [], ['attributes' => ['title' => 'Test link 1 title']])),
\Drupal::l(t('link 2'), new Url('<front>', [], ['attributes' => ['title' => 'Test link 2 title']])),
\Drupal::l(t('link 3'), new Url('<front>', [], ['attributes' => ['title' => 'Test link 3 title']])),
],
'#attributes' => [
'class' => ['toolbar-menu'],
],
],
],
'#weight' => 50,
);
];
return $items;
}
@@ -0,0 +1,59 @@
<?php
namespace Drupal\Tests\toolbar\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Tests the implementation of hook_toolbar() by a module.
*
* @group toolbar
*/
class ToolbarHookToolbarTest extends BrowserTestBase {
/**
* A user with permission to access the administrative toolbar.
*
* @var \Drupal\user\UserInterface
*/
protected $adminUser;
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['toolbar', 'toolbar_test', 'test_page_test'];
protected function setUp() {
parent::setUp();
// Create an administrative user and log it in.
$this->adminUser = $this->drupalCreateUser(['access toolbar']);
$this->drupalLogin($this->adminUser);
}
/**
* Tests for a tab and tray provided by a module implementing hook_toolbar().
*/
public function testHookToolbar() {
$this->drupalGet('test-page');
$this->assertResponse(200);
// Assert that the toolbar is present in the HTML.
$this->assertRaw('id="toolbar-administration"');
// Assert that the tab registered by toolbar_test is present.
$this->assertRaw('id="toolbar-tab-testing"');
// Assert that the tab item descriptions are present.
$this->assertRaw('title="Test tab"');
// Assert that the tray registered by toolbar_test is present.
$this->assertRaw('id="toolbar-tray-testing"');
// Assert that tray item descriptions are present.
$this->assertRaw('title="Test link 1 title"');
}
}