diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-11-07 05:58:51 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-11-07 05:58:51 +0000 |
commit | d2719c2a89cbed5e41767cf60d7bc984955e3ded (patch) | |
tree | 867ceb52fefa3ec8557bccfdb4bddb2b5fef542c | |
parent | 57d35b7fb18619cb68e405f586471ea0ac1453fe (diff) | |
download | brdo-d2719c2a89cbed5e41767cf60d7bc984955e3ded.tar.gz brdo-d2719c2a89cbed5e41767cf60d7bc984955e3ded.tar.bz2 |
#329224 by boombatower and sun: November Make-All-Tests-Pass-Again-Extravaganza: Fix notices in block tests.
-rw-r--r-- | modules/block/block.admin.inc | 4 | ||||
-rw-r--r-- | modules/block/block.test | 24 |
2 files changed, 24 insertions, 4 deletions
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index 8001bef83..773ce2514 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -301,7 +301,7 @@ function block_add_block_form_validate($form, &$form_state) { * Save the new custom block. */ function block_add_block_form_submit($form, &$form_state) { - db_query("INSERT INTO {boxes} (body, info, format) VALUES ('%s', '%s', %d)", $form_state['values']['body'], $form_state['values']['info'], $form_state['values']['format']); + db_query("INSERT INTO {boxes} (body, info, format) VALUES ('%s', '%s', %d)", $form_state['values']['body'], $form_state['values']['info'], $form_state['values']['body_format']); $delta = db_last_insert_id('boxes', 'bid'); foreach (list_themes() as $key => $theme) { @@ -318,8 +318,6 @@ function block_add_block_form_submit($form, &$form_state) { cache_clear_all(); $form_state['redirect'] = 'admin/build/block'; - - return; } /** diff --git a/modules/block/block.test b/modules/block/block.test index 30f54f052..94e0d6e1d 100644 --- a/modules/block/block.test +++ b/modules/block/block.test @@ -20,7 +20,7 @@ class BlockTestCase extends DrupalWebTestCase { parent::setUp(); // Create and login user - $admin_user = $this->drupalCreateUser(array('administer blocks')); + $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer filters')); $this->drupalLogin($admin_user); } @@ -61,6 +61,28 @@ class BlockTestCase extends DrupalWebTestCase { } /** + * Test creating custom block (i.e. box) using Full HTML. + */ + function testBoxFormat() { + // Add a new box by filling out the input form on the admin/build/block/add page. + $box = array(); + $box['info'] = $this->randomName(8); + $box['title'] = $this->randomName(8); + $box['body'] = '<h1>Full HTML</h1>'; + $box['body_format'] = 2; + $this->drupalPost('admin/build/block/add', $box, t('Save block')); + + // Set the created box to a specific region. + $bid = db_result(db_query("SELECT bid FROM {boxes} WHERE info = '%s'", array($box['info']))); + $edit = array(); + $edit['block_' . $bid . '[region]'] = 'left'; + $this->drupalPost('admin/build/block', $edit, t('Save blocks')); + + // Confirm that the box is being displayed using configured input format. + $this->assertRaw('<h1>Full HTML</h1>', t('Box successfully being displayed using Full HTML.')); + } + + /** * Test configuring and moving a module-define block to specific regions. */ function testBlock() { |