Creates a "Basic page" block and verifies its consistency in the database.
public function testCustomBlockCreation() {
// Create a block.
$edit = array();
$langcode = Language::LANGCODE_NOT_SPECIFIED;
$edit['info'] = $this
->randomName(8);
$edit["block_body[{$langcode}][0][value]"] = $this
->randomName(16);
$this
->drupalPost('block/add/basic', $edit, t('Save'));
// Check that the Basic block has been created.
$this
->assertRaw(format_string('!block %name has been created.', array(
'!block' => 'Basic block',
'%name' => $edit["info"],
)), 'Basic block created.');
// Check that the block exists in the database.
$blocks = entity_load_multiple_by_properties('custom_block', array(
'info' => $edit['info'],
));
$block = reset($blocks);
$this
->assertTrue($block, 'Custom Block found in database.');
}