You are here

function ContextReactionBreadcrumbTest::test in Context 6

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

File

tests/context.reactions.test, line 140

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 » Administer » Structure');
  $output = $this
    ->drupalGet('user');
  $this
    ->assertNoText('Home » Administer » Structure');

  // Cleanup
  context_delete($context);
}