summaryrefslogtreecommitdiff
path: root/modules/color/color.test
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-09-01 20:40:40 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-09-01 20:40:40 +0000
commit61d4faab186c34f84390b3be6187d2b95559a55f (patch)
tree27e79d56d1a4e8c7912ade0e6d023f8e396be959 /modules/color/color.test
parenta0b83c11b358d8f9ca3f91e49f2be51a9eda082e (diff)
downloadbrdo-61d4faab186c34f84390b3be6187d2b95559a55f.tar.gz
brdo-61d4faab186c34f84390b3be6187d2b95559a55f.tar.bz2
#497948: Oops. Adding the color.test file.
Diffstat (limited to 'modules/color/color.test')
-rw-r--r--modules/color/color.test50
1 files changed, 50 insertions, 0 deletions
diff --git a/modules/color/color.test b/modules/color/color.test
new file mode 100644
index 000000000..caaa92557
--- /dev/null
+++ b/modules/color/color.test
@@ -0,0 +1,50 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Tests for color module.
+ */
+
+/**
+ * Test color functionality.
+ */
+class ColorTestCase extends DrupalWebTestCase {
+ protected $big_user;
+
+ public static function getInfo() {
+ return array(
+ 'name' => 'Color functionality',
+ 'description' => 'Modify the garland theme color and make sure the changes are reflected on the frontend',
+ 'group' => 'Color',
+ );
+ }
+
+ function setUp() {
+ parent::setUp('color');
+ // Create users.
+ $this->big_user = $this->drupalCreateUser(array('administer site configuration'));
+ }
+
+ /**
+ * Test color module functionality.
+ */
+ function testColor() {
+ $this->drupalLogin($this->big_user);
+ $this->drupalGet('admin/appearance/settings/garland');
+ $this->assertResponse(200);
+ $edit['scheme'] = '';
+ $edit['palette[link]'] = '#123456';
+ $this->drupalPost('admin/appearance/settings/garland', $edit, t('Save configuration'));
+
+ global $theme_key;
+ $this->drupalGet('<front>');
+ $stylesheets = variable_get('color_' . $theme_key . '_stylesheets', array());
+ $this->assertPattern('|' . file_create_url($stylesheets[0]) . '|', 'Make sure the color stylesheet is included in the content.');
+
+ $stylesheet_content = join("\n", file($stylesheets[0]));
+ $matched = preg_match('/(.*color: #123456.*)/i', $stylesheet_content, $matches);
+ $this->assertTrue($matched == 1, 'Make sure the color we changed is in the color stylesheet.');
+ }
+
+}