You are here

function ContextConditionNodeTaxonomyTest::test in Context 7.3

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

File

tests/context.conditions.test, line 183

Class

ContextConditionNodeTaxonomyTest

Code

function test() {

  // Apples does trigger the context.
  $edit = array(
    'title' => 'Apples',
    'field_tags[und]' => $this->terms['apples']->name,
  );
  $this
    ->drupalPost('node/add/article', $edit, t('Save'));
  $node = $this
    ->drupalGetNodeByTitle($edit['title']);
  $this
    ->drupalGet('node/' . $node->nid);
  $this
    ->assertText('Active context: testcontext');

  // Oranges does not trigger the context.
  $edit = array(
    'title' => 'Oranges',
    'field_tags[und]' => $this->terms['oranges']->name,
  );
  $this
    ->drupalPost('node/add/article', $edit, t('Save'));
  $node = $this
    ->drupalGetNodeByTitle($edit['title']);
  $this
    ->drupalGet('node/' . $node->nid);
  $this
    ->assertNoText('Active context: testcontext');
}