summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/block/block.test4
-rw-r--r--modules/block/tests/block_test.module8
-rw-r--r--modules/block/tests/themes/block_test_theme/block_test_theme.info (renamed from themes/tests/block_test_theme/block_test_theme.info)0
-rw-r--r--modules/block/tests/themes/block_test_theme/page.tpl.php (renamed from themes/tests/block_test_theme/page.tpl.php)0
-rw-r--r--modules/simpletest/tests/theme.test2
-rw-r--r--modules/simpletest/tests/theme_test.module8
-rw-r--r--modules/simpletest/tests/themes/test_theme/template.php (renamed from themes/tests/test_theme/template.php)0
-rw-r--r--modules/simpletest/tests/themes/test_theme/test_theme.info (renamed from themes/tests/test_theme/test_theme.info)0
-rw-r--r--modules/system/system.api.php19
-rw-r--r--modules/system/system.module12
-rw-r--r--modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info (renamed from themes/tests/update_test_basetheme/update_test_basetheme.info)0
-rw-r--r--modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info (renamed from themes/tests/update_test_subtheme/update_test_subtheme.info)0
-rw-r--r--modules/update/tests/update_test.module9
-rw-r--r--themes/tests/README.txt4
14 files changed, 62 insertions, 4 deletions
diff --git a/modules/block/block.test b/modules/block/block.test
index 9639b2c10..323034062 100644
--- a/modules/block/block.test
+++ b/modules/block/block.test
@@ -764,6 +764,10 @@ class BlockHiddenRegionTestCase extends DrupalWebTestCase {
);
}
+ function setUp() {
+ parent::setUp(array('block_test'));
+ }
+
/**
* Tests that hidden regions do not inherit blocks when a theme is enabled.
*/
diff --git a/modules/block/tests/block_test.module b/modules/block/tests/block_test.module
index 2abc433c9..5e06d5cf5 100644
--- a/modules/block/tests/block_test.module
+++ b/modules/block/tests/block_test.module
@@ -6,6 +6,14 @@
*/
/**
+ * Implements hook_system_theme_info().
+ */
+function block_test_system_theme_info() {
+ $themes['block_test_theme'] = drupal_get_path('module', 'block_test') . '/themes/block_test_theme/block_test_theme.info';
+ return $themes;
+}
+
+/**
* Implements hook_block_info().
*/
function block_test_block_info() {
diff --git a/themes/tests/block_test_theme/block_test_theme.info b/modules/block/tests/themes/block_test_theme/block_test_theme.info
index 06b6e995f..06b6e995f 100644
--- a/themes/tests/block_test_theme/block_test_theme.info
+++ b/modules/block/tests/themes/block_test_theme/block_test_theme.info
diff --git a/themes/tests/block_test_theme/page.tpl.php b/modules/block/tests/themes/block_test_theme/page.tpl.php
index ba72882ef..ba72882ef 100644
--- a/themes/tests/block_test_theme/page.tpl.php
+++ b/modules/block/tests/themes/block_test_theme/page.tpl.php
diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test
index ea0f257dd..d54885099 100644
--- a/modules/simpletest/tests/theme.test
+++ b/modules/simpletest/tests/theme.test
@@ -9,6 +9,8 @@
* Unit tests for the Theme API.
*/
class ThemeUnitTest extends DrupalWebTestCase {
+ protected $profile = 'testing';
+
public static function getInfo() {
return array(
'name' => 'Theme API',
diff --git a/modules/simpletest/tests/theme_test.module b/modules/simpletest/tests/theme_test.module
index 160d192dd..9cec5381d 100644
--- a/modules/simpletest/tests/theme_test.module
+++ b/modules/simpletest/tests/theme_test.module
@@ -1,6 +1,14 @@
<?php
/**
+ * Implements hook_system_theme_info().
+ */
+function theme_test_system_theme_info() {
+ $themes['test_theme'] = drupal_get_path('module', 'theme_test') . '/themes/test_theme/test_theme.info';
+ return $themes;
+}
+
+/**
* Implements hook_menu().
*/
function theme_test_menu() {
diff --git a/themes/tests/test_theme/template.php b/modules/simpletest/tests/themes/test_theme/template.php
index ef8118a6d..ef8118a6d 100644
--- a/themes/tests/test_theme/template.php
+++ b/modules/simpletest/tests/themes/test_theme/template.php
diff --git a/themes/tests/test_theme/test_theme.info b/modules/simpletest/tests/themes/test_theme/test_theme.info
index dd5584b0b..dd5584b0b 100644
--- a/themes/tests/test_theme/test_theme.info
+++ b/modules/simpletest/tests/themes/test_theme/test_theme.info
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index f241eea78..e2fe6c619 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -1907,6 +1907,25 @@ function hook_module_implements_alter(&$implementations, $hook) {
}
/**
+ * Return additional themes provided by modules.
+ *
+ * Only use this hook for testing purposes. Use a hidden MYMODULE_test.module
+ * to implement this hook. Testing themes should be hidden, too.
+ *
+ * This hook is invoked from _system_rebuild_theme_data() and allows modules to
+ * register additional themes outside of the regular 'themes' directories of a
+ * Drupal installation.
+ *
+ * @return
+ * An associative array. Each key is the system name of a theme and each value
+ * is the corresponding path to the theme's .info file.
+ */
+function hook_system_theme_info() {
+ $themes['mymodule_test_theme'] = drupal_get_path('module', 'mymodule') . '/mymodule_test_theme/mymodule_test_theme.info';
+ return $themes;
+}
+
+/**
* Alter the information parsed from module and theme .info files
*
* This hook is invoked in _system_rebuild_module_data() and in
diff --git a/modules/system/system.module b/modules/system/system.module
index 46ec87db1..eac76a33d 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -2472,6 +2472,18 @@ function _system_update_bootstrap_status() {
function _system_rebuild_theme_data() {
// Find themes
$themes = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.info$/', 'themes');
+ // Allow modules to add further themes.
+ if ($module_themes = module_invoke_all('system_theme_info')) {
+ foreach ($module_themes as $name => $uri) {
+ // @see file_scan_directory()
+ $themes[$name] = (object) array(
+ 'uri' => $uri,
+ 'filename' => pathinfo($uri, PATHINFO_FILENAME),
+ 'name' => $name,
+ );
+ }
+ }
+
// Find theme engines
$engines = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.engine$/', 'themes/engines');
diff --git a/themes/tests/update_test_basetheme/update_test_basetheme.info b/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info
index 9718784f6..9718784f6 100644
--- a/themes/tests/update_test_basetheme/update_test_basetheme.info
+++ b/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info
diff --git a/themes/tests/update_test_subtheme/update_test_subtheme.info b/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
index 6ca42f456..6ca42f456 100644
--- a/themes/tests/update_test_subtheme/update_test_subtheme.info
+++ b/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
diff --git a/modules/update/tests/update_test.module b/modules/update/tests/update_test.module
index 4acb6ef83..e7ee43eec 100644
--- a/modules/update/tests/update_test.module
+++ b/modules/update/tests/update_test.module
@@ -1,6 +1,15 @@
<?php
/**
+ * Implements hook_system_theme_info().
+ */
+function update_test_system_theme_info() {
+ $themes['update_test_basetheme'] = drupal_get_path('module', 'update_test') . '/themes/update_test_basetheme/update_test_basetheme.info';
+ $themes['update_test_subtheme'] = drupal_get_path('module', 'update_test') . '/themes/update_test_subtheme/update_test_subtheme.info';
+ return $themes;
+}
+
+/**
* Implements hook_menu().
*/
function update_test_menu() {
diff --git a/themes/tests/README.txt b/themes/tests/README.txt
deleted file mode 100644
index 5ddaa8caf..000000000
--- a/themes/tests/README.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-The themes in this subdirectory are all used by the Drupal core testing
-framework. They are not functioning themes that could be used on a real site
-and are hidden in the administrative user interface.