summaryrefslogtreecommitdiff
path: root/modules/simpletest/simpletest.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest/simpletest.module')
-rw-r--r--modules/simpletest/simpletest.module22
1 files changed, 17 insertions, 5 deletions
diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module
index 58d289078..cbbd45388 100644
--- a/modules/simpletest/simpletest.module
+++ b/modules/simpletest/simpletest.module
@@ -83,6 +83,19 @@ function simpletest_theme() {
}
/**
+ * Implementation of hook_stream_wrappers().
+ */
+function simpletest_test_stream_wrappers() {
+ return array(
+ 'simpletest' => array(
+ 'name' => t('Simpletest files'),
+ 'class' => 'DrupalSimpleTestStreamWrapper',
+ 'description' => t('Stream Wrapper for Simpletest files.'),
+ ),
+ );
+}
+
+/**
* Implement hook_js_alter().
*/
function simpletest_js_alter(&$javascript) {
@@ -260,7 +273,7 @@ function simpletest_last_test_get($test_id) {
* Found any entries in log.
*/
function simpletest_log_read($test_id, $prefix, $test_class, $during_test = FALSE) {
- $log = file_directory_path() . ($during_test ? '' : '/simpletest/' . substr($prefix, 10)) . '/error.log';
+ $log = 'public://' . ($during_test ? '' : '/simpletest/' . substr($prefix, 10)) . '/error.log';
$found = FALSE;
if (file_exists($log)) {
foreach (file($log) as $line) {
@@ -418,12 +431,11 @@ function simpletest_clean_database() {
* Find all leftover temporary directories and remove them.
*/
function simpletest_clean_temporary_directories() {
- $directory = file_directory_path() . '/simpletest';
- $files = scandir($directory);
+ $files = scandir('public://');
$count = 0;
foreach ($files as $file) {
- $path = "$directory/$file";
- if (is_dir($path) && is_numeric($file)) {
+ $path = 'public://' . $file;
+ if (is_dir($path) && preg_match('/^simpletest\d+/', $file)) {
file_unmanaged_delete_recursive($path);
$count++;
}