From 17120363ab49190b7bb9f9e29a27889e5ece3bbb Mon, 6 Jun 2011 20:44:28 +0200 From: Bram Goffings Date: Mon, 6 Jun 2011 20:44:18 +0200 Subject: [PATCH] Test only color security fix diff --git a/modules/color/color.test b/modules/color/color.test index 1ddfc06..f8771f2 100644 --- a/modules/color/color.test +++ b/modules/color/color.test @@ -93,4 +93,24 @@ $this->assertTrue(strpos($stylesheet_content, 'public://') === FALSE, 'Make sure the color paths have been translated to local paths. (' . $theme . ')'); variable_set('preprocess_css', 0); } + + /** + * Test to see if the provided color is valid. + */ + function testValidColor() { + variable_set('theme_default', 'bartik'); + $settings_path = 'admin/appearance/settings/bartik'; + + $this->drupalLogin($this->big_user); + $edit['scheme'] = ''; + + $edit['palette[bg]'] = '#abcdefg'; + $this->drupalPost($settings_path, $edit, t('Save configuration')); + $this->assertText('Main background must be a valid hexadecimal CSS color value'); + + $edit['palette[bg]'] = '#z01234'; + $this->drupalPost($settings_path, $edit, t('Save configuration')); + $this->assertText('Main background must be a valid hexadecimal CSS color value'); + } }