diff options
Diffstat (limited to 'modules/block/block.test')
-rw-r--r-- | modules/block/block.test | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/modules/block/block.test b/modules/block/block.test index 417a18d5f..0f9eaafe4 100644 --- a/modules/block/block.test +++ b/modules/block/block.test @@ -549,3 +549,41 @@ class BlockCacheTestCase extends DrupalWebTestCase { } } } + +/** + * Test block HTML id validity. + */ +class BlockHTMLIdTestCase extends DrupalWebTestCase { + + public static function getInfo() { + return array( + 'name' => 'Block HTML id', + 'description' => 'Test block HTML id validity.', + 'group' => 'Block', + ); + } + + function setUp() { + parent::setUp('block_test'); + + // Create an admin user, log in and enable test blocks. + $this->admin_user = $this->drupalCreateUser(array('administer blocks', 'access administration pages')); + $this->drupalLogin($this->admin_user); + + // Enable our test block. + $edit['block_test_test_html_id[region]'] = 'sidebar_first'; + $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); + + // Make sure the block has some content so it will appear + $current_content = $this->randomName(); + variable_set('block_test_content', $current_content); + } + + /** + * Test valid HTML id. + */ + function testHTMLId() { + $this->drupalGet(''); + $this->assertRaw('block-block-test-test-html-id', t('HTML id for test block is valid.')); + } +} |