You are here

function ContextConditionSitewideTest::test in Context 7.3

Same name and namespace in other branches
  1. 6.3 tests/context.conditions.test \ContextConditionSitewideTest::test()
  2. 6 tests/context.conditions.test \ContextConditionSitewideTest::test()

File

tests/context.conditions.test, line 265

Class

ContextConditionSitewideTest

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);
}