Commit c10a2536 authored by webchick's avatar webchick

Issue #1611430 follow-up by Berdir: Move call to file_create_url() to later in...

Issue #1611430 follow-up by Berdir: Move call to file_create_url() to later in the verbose mode process.
parent edb9ffa3
......@@ -128,6 +128,13 @@ abstract class TestBase {
*/
protected $originalPrefix;
/**
* URL to the verbose output file directory.
*
* @var string
*/
protected $verboseDirectoryUrl;
/**
* Constructor for Test.
*
......@@ -544,7 +551,7 @@ protected function verbose($message) {
$message = '<hr />ID #' . $this->verboseId . ' (<a href="' . $this->verboseClassName . '-' . ($this->verboseId - 1) . '.html">Previous</a> | <a href="' . $this->verboseClassName . '-' . ($this->verboseId + 1) . '.html">Next</a>)<hr />' . $message;
$verbose_filename = $this->verboseDirectory . '/' . $this->verboseClassName . '-' . $this->verboseId . '.html';
if (file_put_contents($verbose_filename, $message, FILE_APPEND)) {
$url = file_create_url($this->originalFileDirectory . '/simpletest/verbose/' . $this->verboseClassName . '-' . $this->verboseId . '.html');
$url = $this->verboseDirectoryUrl . '/' . $this->verboseClassName . '-' . $this->verboseId . '.html';
// Not using l() to avoid invoking the theme system, so that unit tests
// can use verbose() as well.
$url = '<a href="' . $url . '" target="_blank">' . t('Verbose message') . '</a>';
......@@ -573,6 +580,7 @@ public function run(array $methods = array()) {
// Initialize verbose debugging.
$this->verbose = TRUE;
$this->verboseDirectory = variable_get('file_public_path', conf_path() . '/files') . '/simpletest/verbose';
$this->verboseDirectoryUrl = file_create_url($this->verboseDirectory);
if (file_prepare_directory($this->verboseDirectory, FILE_CREATE_DIRECTORY) && !file_exists($this->verboseDirectory . '/.htaccess')) {
file_put_contents($this->verboseDirectory . '/.htaccess', "<IfModule mod_expires.c>\nExpiresActive Off\n</IfModule>\n");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment