function ContextConditionSitewideTest::test in Context 6
Same name and namespace in other branches
- 6.3 tests/context.conditions.test \ContextConditionSitewideTest::test()
- 7.3 tests/context.conditions.test \ContextConditionSitewideTest::test()
File
- tests/
context.conditions.test, line 244
Class
Code
function test() {
ctools_include('export');
$context = ctools_export_new_object('context');
$context->name = 'testcontext';
$context->conditions = array(
'sitewide' => array(
'values' => array(
1,
),
),
);
$context->reactions = array(
'debug' => array(
'debug' => TRUE,
),
);
$saved = context_save($context);
$this
->assertTrue($saved, "Context 'testcontext' saved.");
$this
->drupalGet('node');
$this
->assertText('Active context: testcontext');
// Cleanup
context_delete($context);
}