summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/common.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-10-26 18:06:39 +0000
committerDries Buytaert <dries@buytaert.net>2008-10-26 18:06:39 +0000
commitdf2cf40d2cd197ed5f1960b026b31aad32b5d930 (patch)
treec34e2f3b6f44f11002859353864f32ce613fa71c /modules/simpletest/tests/common.test
parent617fe51e625e1bf43d31c8c3f08325d67af2d9d4 (diff)
downloadbrdo-df2cf40d2cd197ed5f1960b026b31aad32b5d930.tar.gz
brdo-df2cf40d2cd197ed5f1960b026b31aad32b5d930.tar.bz2
- Patch #266358 by Rob Loach, mfer: use array in drupal_add_css().
Diffstat (limited to 'modules/simpletest/tests/common.test')
-rw-r--r--modules/simpletest/tests/common.test50
1 files changed, 50 insertions, 0 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 74e053cf9..6a82018db 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -115,6 +115,56 @@ class DrupalTagsHandlingTestCase extends DrupalWebTestCase {
}
/**
+ * Test the Drupal CSS system.
+ */
+class CascadingStylesheetsTestCase extends DrupalWebTestCase {
+ /**
+ * Implementation of getInfo().
+ */
+ function getInfo() {
+ return array(
+ 'name' => t('Cascading stylesheets'),
+ 'description' => t('Tests adding various cascading stylesheets to the page.'),
+ 'group' => t('System')
+ );
+ }
+
+ /**
+ * Implementation of setUp().
+ */
+ function setUp() {
+ parent::setUp();
+ // Reset drupal_add_css() before each test.
+ drupal_add_css(NULL, NULL, TRUE);
+ }
+
+ /**
+ * Check default stylesheets as empty.
+ */
+ function testDefault() {
+ $this->assertEqual(array(), drupal_add_css(), t('Default CSS is empty.'));
+ }
+
+ /**
+ * Tests adding a file stylesheet.
+ */
+ function testAddFile() {
+ $path = drupal_get_path('module', 'simpletest') . '/simpletest.css';
+ $css = drupal_add_css($path);
+ $this->assertEqual($css['all']['module'][$path], TRUE, t('Adding a CSS file caches it properly.'));
+ }
+
+ /**
+ * Tests rendering the stylesheets.
+ */
+ function testRenderFile() {
+ $css = drupal_get_path('module', 'simpletest') . '/simpletest.css';
+ drupal_add_css($css);
+ $this->assertTrue(strpos(drupal_get_css(), $css) > 0, t('Rendered CSS includes the added stylesheet.'));
+ }
+}
+
+/**
* Test drupal_http_request().
*/
class DrupalHTTPRequestTestCase extends DrupalWebTestCase {