#329224 by boombatower and sun: November Make-All-Tests-Pass-Again-Extravaganza: Fix notices in block tests.
parent
57d35b7fb1
commit
d2719c2a89
|
@ -301,7 +301,7 @@ function block_add_block_form_validate($form, &$form_state) {
|
||||||
* Save the new custom block.
|
* Save the new custom block.
|
||||||
*/
|
*/
|
||||||
function block_add_block_form_submit($form, &$form_state) {
|
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');
|
$delta = db_last_insert_id('boxes', 'bid');
|
||||||
|
|
||||||
foreach (list_themes() as $key => $theme) {
|
foreach (list_themes() as $key => $theme) {
|
||||||
|
@ -318,8 +318,6 @@ function block_add_block_form_submit($form, &$form_state) {
|
||||||
cache_clear_all();
|
cache_clear_all();
|
||||||
|
|
||||||
$form_state['redirect'] = 'admin/build/block';
|
$form_state['redirect'] = 'admin/build/block';
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -20,7 +20,7 @@ class BlockTestCase extends DrupalWebTestCase {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// Create and login user
|
// Create and login user
|
||||||
$admin_user = $this->drupalCreateUser(array('administer blocks'));
|
$admin_user = $this->drupalCreateUser(array('administer blocks', 'administer filters'));
|
||||||
$this->drupalLogin($admin_user);
|
$this->drupalLogin($admin_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,28 @@ class BlockTestCase extends DrupalWebTestCase {
|
||||||
$this->assertNoText(t($box['title']), t('Box no longer appears on page.'));
|
$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.
|
* Test configuring and moving a module-define block to specific regions.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue