You are here

function ContextConditionNodeTaxonomyTest::test in Context 6

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

File

tests/context.conditions.test, line 175

Class

ContextConditionNodeTaxonomyTest

Code

function test() {

  // Apples does trigger the context.
  $this
    ->drupalPost('node/add/page', array(
    'title' => 'Apples',
    "taxonomy[{$this->vocab['vid']}]" => $this->terms['apples']['tid'],
  ), 'Save');
  $this
    ->assertText('Active context: testcontext');

  // Oranges does not trigger the context.
  $this
    ->drupalPost('node/add/page', array(
    'title' => 'Oranges',
    "taxonomy[{$this->vocab['vid']}]" => $this->terms['oranges']['tid'],
  ), 'Save');
  $this
    ->assertNoText('Active context: testcontext');
}