diff -u b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php --- b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -868,16 +868,18 @@ /** * Creates simpletest_settings.php file. * - * @param array $lines - * Lines to add to the simpletest_settings.php, for eaxmple: + * @param array $conf + * Conf overrides to add to the simpletest_settings.php, for eaxmple: * @code * array( - * "\$conf['page_cache_without_database'] = TRUE;", + * 'page_cache_without_database' = TRUE, * ); * @endcode */ - protected function createSimpletestSettingsFile($lines = array()) { - $header = <<additionalSettingsDirectory . '/simpletest_settings.php', $contents); } + protected function deleteSimpletestSettingsFile() { + unlink($this->additionalSettingsDirectory . '/simpletest_settings.php'); + } } diff -u b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php --- b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php @@ -115,15 +115,22 @@ * Test ability for settings.php to specify a non-database backend for the page cache. */ function testPageCacheWithoutDatabase() { - $conf_lines = array( - "\$conf['page_cache_without_database'] = TRUE;", - "\$conf['cache_backends'][] = 'core/modules/system/tests/modules/bootstrap_test/lib/Drupal/bootstrap_test/Cache/TestBackend.php';", - "\$conf['cache_classes']['cache'] = 'Drupal\\Core\\Cache\\DatabaseBackend';", - "\$conf['cache_classes']['page'] = 'Drupal\\bootstrap_test\\Cache\\TestBackend';", + $conf = array( + 'page_cache_without_database' => TRUE, + 'cache_backends' => array( + 'core/modules/system/tests/modules/bootstrap_test/lib/Drupal/bootstrap_test/Cache/TestBackend.php', + ), + 'cache_classes' => array( + 'cache' => 'Drupal\Core\Cache\DatabaseBackend', + 'page' => 'Drupal\bootstrap_test\Cache\TestBackend', + ), ); - $this->createSimpletestSettingsFile($conf_lines); + + $this->createSimpletestSettingsFile($conf); $this->drupalGet(''); $this->assertText('Page returned by Drupal\bootstrap_test\Cache\TestBackend'); + // Have to clean up settings file so that is does not affect other tests + $this->deleteSimpletestSettingsFile(); } /**