summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest/tests')
-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.php21
-rw-r--r--modules/simpletest/tests/themes/test_theme/test_theme.info16
4 files changed, 47 insertions, 0 deletions
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/modules/simpletest/tests/themes/test_theme/template.php b/modules/simpletest/tests/themes/test_theme/template.php
new file mode 100644
index 000000000..ef8118a6d
--- /dev/null
+++ b/modules/simpletest/tests/themes/test_theme/template.php
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Tests a theme overriding a suggestion of a base theme hook.
+ */
+function test_theme_breadcrumb__suggestion($variables) {
+ // Tests that preprocess functions for the base theme hook get called even
+ // when the suggestion has an implementation.
+ return 'test_theme_breadcrumb__suggestion: ' . $variables['theme_test_preprocess_breadcrumb'];
+}
+
+/**
+ * Tests a theme implementing an alter hook.
+ *
+ * The confusing function name here is due to this being an implementation of
+ * the alter hook invoked when the 'theme_test' module calls
+ * drupal_alter('theme_test_alter').
+ */
+function test_theme_theme_test_alter_alter(&$data) {
+ $data = 'test_theme_theme_test_alter_alter was invoked';
+}
diff --git a/modules/simpletest/tests/themes/test_theme/test_theme.info b/modules/simpletest/tests/themes/test_theme/test_theme.info
new file mode 100644
index 000000000..dd5584b0b
--- /dev/null
+++ b/modules/simpletest/tests/themes/test_theme/test_theme.info
@@ -0,0 +1,16 @@
+name = Test theme
+description = Theme for testing the theme system
+core = 7.x
+hidden = TRUE
+
+; Normally, themes may list CSS files like this, and if they exist in the theme
+; folder, then they get added to the page. If they have the same file name as a
+; module CSS file, then the theme's version overrides the module's version, so
+; that the module's version is not added to the page. Additionally, a theme may
+; have an entry like this one, without having the corresponding CSS file in the
+; theme's folder, and in this case, it just stops the module's version from
+; being loaded, and does not replace it with an alternate version. We have this
+; here in order for a test to ensure that this correctly prevents the module
+; version from being loaded, and that errors aren't caused by the lack of this
+; file within the theme folder.
+stylesheets[all][] = system.base.css