summaryrefslogtreecommitdiff
path: root/modules/block/block.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/block/block.test')
-rw-r--r--modules/block/block.test9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/block/block.test b/modules/block/block.test
index b6b1dd54b..34618e92d 100644
--- a/modules/block/block.test
+++ b/modules/block/block.test
@@ -46,7 +46,7 @@ class BlockTestCase extends DrupalWebTestCase {
// Confirm that the box has been created, and then query the created bid.
$this->assertText(t('The block has been created.'), t('Box successfully created.'));
- $bid = db_result(db_query("SELECT bid FROM {box} WHERE info = '%s'", array($box['info'])));
+ $bid = db_query("SELECT bid FROM {box} WHERE info = :info", array(':info' => $box['info']))->fetchField();
// Check to see if the box was created by checking that it's in the database..
$this->assertNotNull($bid, t('Box found in database'));
@@ -78,7 +78,7 @@ class BlockTestCase extends DrupalWebTestCase {
$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 {box} WHERE info = '%s'", array($box['info'])));
+ $bid = db_query("SELECT bid FROM {box} WHERE info = :info", array(':info' => $box['info']))->fetchField();
$edit = array();
$edit['block_' . $bid . '[region]'] = 'left';
$this->drupalPost('admin/build/block', $edit, t('Save blocks'));
@@ -112,7 +112,10 @@ class BlockTestCase extends DrupalWebTestCase {
// Set block title to confirm that interface works and override any custom titles.
$this->drupalPost('admin/build/block/configure/' . $block['module'] . '/' . $block['delta'], array('title' => $block['title']), t('Save block'));
$this->assertText(t('The block configuration has been saved.'), t('Block title set.'));
- $bid = db_result(db_query("SELECT bid FROM {block} WHERE module = '%s' AND delta = %d", array($block['module'], $block['delta'])));
+ $bid = db_query("SELECT bid FROM {block} WHERE module = :module AND delta = :delta", array(
+ ':module' => $block['module'],
+ ':delta' => $block['delta'],
+ ))->fetchField();
// Check to see if the block was created by checking that it's in the database.
$this->assertNotNull($bid, t('Block found in database'));