/[drupal]/drupal/modules/color/color.test
ViewVC logotype

Contents of /drupal/modules/color/color.test

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Tue Sep 1 20:40:40 2009 UTC (2 months, 3 weeks ago) by webchick
Branch: MAIN
CVS Tags: DRUPAL-7-0-UNSTABLE-9, DRUPAL-7-0-UNSTABLE-10, HEAD
File MIME type: text/x-php
#497948: Oops. Adding the color.test file.
1 <?php
2 // $Id$
3
4 /**
5 * @file
6 * Tests for color module.
7 */
8
9 /**
10 * Test color functionality.
11 */
12 class ColorTestCase extends DrupalWebTestCase {
13 protected $big_user;
14
15 public static function getInfo() {
16 return array(
17 'name' => 'Color functionality',
18 'description' => 'Modify the garland theme color and make sure the changes are reflected on the frontend',
19 'group' => 'Color',
20 );
21 }
22
23 function setUp() {
24 parent::setUp('color');
25 // Create users.
26 $this->big_user = $this->drupalCreateUser(array('administer site configuration'));
27 }
28
29 /**
30 * Test color module functionality.
31 */
32 function testColor() {
33 $this->drupalLogin($this->big_user);
34 $this->drupalGet('admin/appearance/settings/garland');
35 $this->assertResponse(200);
36 $edit['scheme'] = '';
37 $edit['palette[link]'] = '#123456';
38 $this->drupalPost('admin/appearance/settings/garland', $edit, t('Save configuration'));
39
40 global $theme_key;
41 $this->drupalGet('<front>');
42 $stylesheets = variable_get('color_' . $theme_key . '_stylesheets', array());
43 $this->assertPattern('|' . file_create_url($stylesheets[0]) . '|', 'Make sure the color stylesheet is included in the content.');
44
45 $stylesheet_content = join("\n", file($stylesheets[0]));
46 $matched = preg_match('/(.*color: #123456.*)/i', $stylesheet_content, $matches);
47 $this->assertTrue($matched == 1, 'Make sure the color we changed is in the color stylesheet.');
48 }
49
50 }

  ViewVC Help
Powered by ViewVC 1.1.2