You are here

function ContextReactionBreadcrumbTest::test in Context 7.3

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

File

tests/context.reactions.test, line 199

Class

ContextReactionBreadcrumbTest

Code

function test() {
  ctools_include('export');
  $context = ctools_export_new_object('context');
  $context->name = 'testcontext';
  $context->conditions = array(
    'path' => array(
      'values' => array(
        'node',
      ),
    ),
  );
  $context->reactions = array(
    'breadcrumb' => 'admin/structure',
  );
  $saved = context_save($context);
  $this
    ->assertTrue($saved, "Context 'testcontext' saved.");
  theme_enable(array(
    'bartik',
  ));
  variable_set('theme_default', 'bartik');
  $this
    ->refreshVariables();
  $output = $this
    ->drupalGet('node');
  $this
    ->assertText('Home » Administration » Structure');
  $output = $this
    ->drupalGet('user');
  $this
    ->assertNoText('Home » Administration » Structure');

  // Cleanup
  context_delete($context);
}