Commit d2719c2a authored by webchick's avatar webchick

#329224 by boombatower and sun: November...

#329224 by boombatower and sun: November Make-All-Tests-Pass-Again-Extravaganza: Fix notices in block tests.
parent 57d35b7f
......@@ -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;
}
/**
......
......@@ -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);
}
......@@ -60,6 +60,28 @@ class BlockTestCase extends DrupalWebTestCase {
$this->assertNoText(t($box['title']), t('Box no longer appears on page.'));
}
/**
* 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.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment