public function BlockAttributesViewsTestCase::setUp in Block Attributes 7
Enable modules and create the data necessary to run the tests.
Overrides BlockAttributesTestCase::setUp
File
- ./
block_attributes.test, line 552 - Test the Block Attributes module.
Class
- BlockAttributesViewsTestCase
- Test Block Attributes integration with Views block.
Code
public function setUp() {
// Override default parameters to test with the Views: Archive block.
$this->module = 'views';
$this->delta = 'archive-block';
// Include the Views module and its dependencies to be loaded.
parent::setUp('views');
// Programmatically enable the default Archive View, based on #820110-1.
$status = variable_get('views_defaults', array());
$status['archive'] = FALSE;
variable_set('views_defaults', $status);
// Note that the Views Archive block is not visible on the Block admin page
// unless the registry is rebuilt with: registry_rebuild().
// Directly publish the Views Archive Block to the content region.
$this
->drupalPost("admin/structure/block/manage/{$this->module}/{$this->delta}/configure", array(
'regions[bartik]' => 'content',
), t('Save block'));
// Create a sample node to have some data to display in Views: Archive.
$this
->drupalCreateNode(array(
'type' => 'page',
'status' => 1,
'uid' => $this->privilegedUser->uid,
));
}