You are here

function ContextReactionRegionTest::test in Context 7.3

File

tests/context.reactions.test, line 281

Class

ContextReactionRegionTest

Code

function test() {
  ctools_include('export');
  theme_enable(array(
    'bartik',
  ));
  variable_set('theme_default', 'bartik');
  global $theme;
  $context = ctools_export_new_object('context');
  $context->name = 'testcontext';
  $context->conditions = array(
    'sitewide' => array(
      'values' => array(
        1,
      ),
    ),
  );
  $context->reactions = array(
    'block' => array(
      'blocks' => array(
        'user-online' => array(
          'module' => 'user',
          'delta' => 'online',
          'region' => 'sidebar_first',
          'weight' => '-10',
        ),
      ),
    ),
    'region' => array(
      'bartik' => array(
        'disable' => array(
          'sidebar_first' => 'sidebar_first',
        ),
      ),
    ),
  );
  $saved = context_save($context);
  $this
    ->assertTrue($saved, "Context 'testcontext' saved.");
  $output = $this
    ->drupalGet('node');
  $this
    ->assertNoText("Who's online");

  // Cleanup
  context_delete($context);
}