Update to Drupal 8.0.0 beta 14. For more information, see https://drupal.org/node/2544542

This commit is contained in:
Pantheon Automation 2015-08-27 12:03:05 -07:00 committed by Greg Anderson
parent 3b2511d96d
commit 81ccda77eb
2155 changed files with 54307 additions and 46870 deletions

View file

@ -85,6 +85,7 @@ class EngineTwigTest extends WebTestBase {
'link via the linkgenerator: ' . $link_generator->generate('register', new Url('user.register', [], ['absolute' => TRUE, 'attributes' => ['foo' => 'bar']])),
'link via the linkgenerator: ' . $link_generator->generate('register', new Url('user.register', [], ['attributes' => ['foo' => 'bar', 'id' => 'kitten']])),
'link via the linkgenerator: ' . $link_generator->generate('register', new Url('user.register', [], ['attributes' => ['id' => 'kitten']])),
'link via the linkgenerator: ' . $link_generator->generate('register', new Url('user.register', [], ['attributes' => ['class' => ['llama', 'kitten', 'panda']]])),
];
// Verify that link() has the ability to bubble cacheability metadata:

View file

@ -94,13 +94,13 @@ class ThemeInfoTest extends WebTestBase {
$active_theme = $this->themeManager->getActiveTheme();
// Make sure we are not testing the wrong theme.
$this->assertEqual('test_theme', $active_theme->getName());
$this->assertEqual(['classy/base', 'test_theme/global-styling'], $active_theme->getLibraries());
$this->assertEqual(['classy/base', 'core/normalize', 'test_theme/global-styling'], $active_theme->getLibraries());
// @see theme_test_system_info_alter()
$this->state->set('theme_test.modify_info_files', TRUE);
drupal_flush_all_caches();
$active_theme = $this->themeManager->getActiveTheme();
$this->assertEqual(['classy/base', 'test_theme/global-styling', 'core/backbone'], $active_theme->getLibraries());
$this->assertEqual(['classy/base', 'core/normalize', 'test_theme/global-styling', 'core/backbone'], $active_theme->getLibraries());
}
}

View file

@ -0,0 +1,60 @@
<?php
/**
* @file
* Contains \Drupal\system\Tests\Theme\ThemeTokenTest.
*/
namespace Drupal\system\Tests\Theme;
use Drupal\simpletest\WebTestBase;
/**
* Tests the generation of 'theme_token' key in Drupal settings.
*
* @group Theme
*/
class ThemeTokenTest extends WebTestBase {
/**
* We want to visit the 'admin/structure/block' page.
*
* @var array
*/
static public $modules = ['block'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$account = $this->drupalCreateUser(['administer blocks', 'view the administration theme']);
$this->drupalLogin($account);
}
/**
* Tests if the 'theme_token' key of 'ajaxPageState' is computed.
*/
public function testThemeToken() {
// Visit the block administrative page with default theme. We use that page
// because 'misc/ajax.js' is loaded there and we can test the token
// generation.
$this->drupalGet('admin/structure/block');
$settings = $this->getDrupalSettings();
$this->assertNull($settings['ajaxPageState']['theme_token']);
// Install 'seven' and configure it as administrative theme.
$this->container->get('theme_installer')->install(['seven']);
$this->config('system.theme')->set('admin', 'seven')->save();
// Revisit the page. This time the page is displayed using the 'seven' theme
// and that is different from the default theme ('classy').
$this->drupalGet('admin/structure/block');
$settings = $this->getDrupalSettings();
$this->assertNotNull($settings['ajaxPageState']['theme_token']);
// The CSRF token is a 43 length string.
$this->assertTrue(is_string($settings['ajaxPageState']['theme_token']));
$this->assertEqual(strlen($settings['ajaxPageState']['theme_token']), 43);
}
}

View file

@ -41,10 +41,10 @@ class TwigEnvironmentTest extends KernelTestBase {
$unsafe_string = '<script>alert(\'Danger! High voltage!\');</script>';
$element['test'] = array(
'#type' => 'inline_template',
'#template' => 'test-with-context {{ unsafe_content }}',
'#template' => 'test-with-context <label>{{ unsafe_content }}</label>',
'#context' => array('unsafe_content' => $unsafe_string),
);
$this->assertEqual($renderer->renderRoot($element), 'test-with-context ' . SafeMarkup::checkPlain($unsafe_string));
$this->assertEqual($renderer->renderRoot($element), 'test-with-context <label>' . SafeMarkup::checkPlain($unsafe_string) . '</label>');
// Enable twig_auto_reload and twig_debug.
$settings = Settings::getAll();