function BlockHashTestCase::assertWeight
Asserts that the block_test module's block has a given weight.
Parameters
$weight: The expected weight.
1 call to BlockHashTestCase::assertWeight()
- BlockHashTestCase::testBlockRehash in modules/
block/ block.test - Tests that block rehashing does not write to the database too often.
File
-
modules/
block/ block.test, line 975
Class
- BlockHashTestCase
- Tests that block rehashing works correctly.
Code
function assertWeight($weight) {
$db_weight = db_query('SELECT weight FROM {block} WHERE module = :module AND delta = :delta', array(
':module' => 'block_test',
':delta' => 'test_html_id',
))->fetchField();
// By casting to string the assert fails on FALSE.
$this->assertIdentical((string) $db_weight, (string) $weight);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.