Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663

This commit is contained in:
Greg Anderson 2015-10-08 11:40:12 -07:00
parent eb34d130a8
commit f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions

View file

@ -74,13 +74,7 @@ class PageCacheTagsIntegrationTest extends WebTestBase {
'route',
'theme',
'timezone',
'user.permissions',
// The user login block access depends on whether the current user is
// logged in or not.
'user.roles:anonymous',
// The cache contexts associated with the (in)accessible menu links are
// bubbled.
'user.roles:authenticated',
'user',
// The placed block is only visible on certain URLs through a visibility
// condition.
'url',
@ -91,10 +85,10 @@ class PageCacheTagsIntegrationTest extends WebTestBase {
'rendered',
'block_view',
'config:block_list',
'config:block.block.bartik_branding',
'config:block.block.bartik_breadcrumbs',
'config:block.block.bartik_content',
'config:block.block.bartik_tools',
'config:block.block.bartik_login',
'config:block.block.bartik_footer',
'config:block.block.bartik_help',
'config:block.block.bartik_search',
@ -105,10 +99,13 @@ class PageCacheTagsIntegrationTest extends WebTestBase {
'config:block.block.bartik_messages',
'config:block.block.bartik_local_actions',
'config:block.block.bartik_local_tasks',
'config:block.block.bartik_page_title',
'node_view',
'node:' . $node_1->id(),
'user:0',
'user:' . $author_1->id(),
'config:filter.format.basic_html',
'config:search.settings',
'config:system.menu.account',
'config:system.menu.tools',
'config:system.menu.footer',
@ -127,10 +124,10 @@ class PageCacheTagsIntegrationTest extends WebTestBase {
'rendered',
'block_view',
'config:block_list',
'config:block.block.bartik_branding',
'config:block.block.bartik_breadcrumbs',
'config:block.block.bartik_content',
'config:block.block.bartik_tools',
'config:block.block.bartik_login',
'config:block.block.bartik_help',
'config:block.block.bartik_search',
'config:block.block.' . $block->id(),
@ -141,10 +138,12 @@ class PageCacheTagsIntegrationTest extends WebTestBase {
'config:block.block.bartik_messages',
'config:block.block.bartik_local_actions',
'config:block.block.bartik_local_tasks',
'config:block.block.bartik_page_title',
'node_view',
'node:' . $node_2->id(),
'user:' . $author_2->id(),
'config:filter.format.full_html',
'config:search.settings',
'config:system.menu.account',
'config:system.menu.tools',
'config:system.menu.footer',
@ -156,6 +155,7 @@ class PageCacheTagsIntegrationTest extends WebTestBase {
// FinishResponseSubscriber adds this cache tag to responses that have the
// 'user.permissions' cache context for anonymous users.
'config:user.role.anonymous',
'user:0',
));
}

View file

@ -399,11 +399,57 @@ class PageCacheTest extends WebTestBase {
// that implementation.
\Drupal::state()->set('page_cache_bypass_form_immutability', TRUE);
\Drupal::moduleHandler()->resetImplementations();
\Drupal::cache('render')->deleteAll();
Cache::invalidateTags(['rendered']);
$this->drupalGet('page_cache_form_test_immutability');
$this->assertText("Immutable: FALSE", "Form is not immutable,");
}
/**
* Tests cacheability of a CacheableResponse.
*
* Tests the difference between having a controller return a plain Symfony
* Response object versus returning a Response object that implements the
* CacheableResponseInterface.
*/
public function testCacheableResponseResponses() {
$config = $this->config('system.performance');
$config->set('cache.page.max_age', 300);
$config->save();
// Try to fill the cache.
$this->drupalGet('/system-test/respond-reponse');
$this->assertFalse(in_array('X-Drupal-Cache', $this->drupalGetHeaders()), 'Drupal page cache header not found');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'must-revalidate, no-cache, post-check=0, pre-check=0, private', 'Cache-Control header was sent');
// Still not cached, uncacheable response.
$this->drupalGet('/system-test/respond-reponse');
$this->assertFalse(in_array('X-Drupal-Cache', $this->drupalGetHeaders()), 'Drupal page cache header not found');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'must-revalidate, no-cache, post-check=0, pre-check=0, private', 'Cache-Control header was sent');
// Try to fill the cache.
$this->drupalGet('/system-test/respond-cacheable-reponse');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', 'Page was not cached.');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'max-age=300, public', 'Cache-Control header was sent.');
// Should be cached now.
$this->drupalGet('/system-test/respond-cacheable-reponse');
$this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'max-age=300, public', 'Cache-Control header was sent.');
// Uninstall page cache. This should flush all caches so the next call to a
// previously cached page should be a miss now.
$this->container->get('module_installer')
->uninstall(['page_cache']);
// Try to fill the cache.
$this->drupalGet('/system-test/respond-reponse');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'must-revalidate, no-cache, post-check=0, pre-check=0, private', 'Cache-Control header was sent');
// Still not cached, uncacheable response.
$this->drupalGet('/system-test/respond-reponse');
$this->assertEqual($this->drupalGetHeader('Cache-Control'), 'must-revalidate, no-cache, post-check=0, pre-check=0, private', 'Cache-Control header was sent');
}
}