public function BlockClassContextTestCase::initializeContext in Block Class 7.2
Same name and namespace in other branches
- 7 block_class.test \BlockClassContextTestCase::initializeContext()
Helper function to initialize a test Context with a test block.
1 call to BlockClassContextTestCase::initializeContext()
- BlockClassContextTestCase::setUp in ./
block_class.test - Enable modules and create user with specific permissions.
File
- ./
block_class.test, line 224 - Test the Block Class module.
Class
- BlockClassContextTestCase
- Test Block Class integration with Context.
Code
public function initializeContext() {
// Import a basic context exported through the admin interface.
$context = new stdClass();
$context->disabled = FALSE;
$context->api_version = 3;
$context->name = 'front';
$context->description = 'Frontpage Context';
$context->tag = '';
$context->conditions = array(
'path' => array(
'values' => array(
'<front>' => '<front>',
),
),
);
$context->reactions = array(
'block' => array(
'blocks' => array(
$this->module . '-' . $this->delta => array(
'module' => $this->module,
'delta' => $this->delta,
'region' => 'content',
'weight' => '-10',
),
),
),
);
$context->condition_mode = 0;
// Translatables
// Included for use with string extractors like potx.
t('Frontpage Context');
// Save the context.
context_save($context);
}