From 0734324871d8711d32565a0c64cb2dbd07eb5f8e Mon Sep 17 00:00:00 2001 From: Bram Goffings Date: Mon, 9 Jan 2012 12:09:13 +0100 Subject: [PATCH] fixed statistics logging test, partialy fixed page caching and session tests --- core/modules/simpletest/tests/bootstrap.test | 12 +++++++++--- core/modules/simpletest/tests/session.test | 7 +++++-- core/modules/statistics/statistics.test | 4 +++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/core/modules/simpletest/tests/bootstrap.test b/core/modules/simpletest/tests/bootstrap.test index 88f3d41feca8..fee8fcc0dd12 100644 --- a/core/modules/simpletest/tests/bootstrap.test +++ b/core/modules/simpletest/tests/bootstrap.test @@ -116,7 +116,9 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase { * Test support for requests containing If-Modified-Since and If-None-Match headers. */ function testConditionalRequests() { - variable_set('cache', 1); + $config = config('system.performance'); + $config->set('cache', 1); + $config->save(); // Fill the cache. $this->drupalGet(''); @@ -154,7 +156,9 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase { * Test cache headers. */ function testPageCache() { - variable_set('cache', 1); + $config = config('system.performance'); + $config->set('cache', 1); + $config->save(); // Fill the cache. $this->drupalGet('system-test/set-header', array('query' => array('name' => 'Foo', 'value' => 'bar'))); @@ -198,7 +202,9 @@ class BootstrapPageCacheTestCase extends DrupalWebTestCase { * mod_deflate Apache module. */ function testPageCompression() { - variable_set('cache', 1); + $config = config('system.performance'); + $config->set('cache', 1); + $config->save(); // Fill the cache and verify that output is compressed. $this->drupalGet('', array(), array('Accept-Encoding: gzip,deflate')); diff --git a/core/modules/simpletest/tests/session.test b/core/modules/simpletest/tests/session.test index 846f6d314c77..cca23bad6ead 100644 --- a/core/modules/simpletest/tests/session.test +++ b/core/modules/simpletest/tests/session.test @@ -139,7 +139,10 @@ class SessionTestCase extends DrupalWebTestCase { $this->assertSessionEmpty(TRUE); // The same behavior is expected when caching is enabled. - variable_set('cache', 1); + $config = config('system.performance'); + $config->set('cache', 1); + $config->save(); + $this->drupalGet(''); $this->assertSessionCookie(FALSE); $this->assertSessionEmpty(TRUE); @@ -455,7 +458,7 @@ class SessionHttpsTestCase extends DrupalWebTestCase { } } - // Test that session data saved before login is not available using the + // Test that session data saved before login is not available using the // pre-login anonymous cookie. $this->cookies = array(); $this->drupalGet('session-test/get', array('Cookie: ' . $anonymous_cookie)); diff --git a/core/modules/statistics/statistics.test b/core/modules/statistics/statistics.test index 592f1653c945..7fac22c35358 100644 --- a/core/modules/statistics/statistics.test +++ b/core/modules/statistics/statistics.test @@ -69,7 +69,9 @@ class StatisticsLoggingTestCase extends DrupalWebTestCase { $this->node = $this->drupalCreateNode(array('title' => $this->randomName(255), 'uid' => $this->auth_user->uid)); // Enable page caching. - variable_set('cache', TRUE); + $config = config('system.performance'); + $config->set('cache', 1); + $config->save(); // Enable access logging. variable_set('statistics_enable_access_log', 1);