You are here

function ContextConditionUserTest::test in Context 6

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

File

tests/context.conditions.test, line 46

Class

ContextConditionUserTest

Code

function test() {

  // User 1 triggers the context.
  $this
    ->drupalLogin($this->user1);
  $this
    ->drupalGet('node');
  $this
    ->assertText('Active context: testcontext');

  // User 2 does not.
  $this
    ->drupalLogin($this->user2);
  $this
    ->drupalGet('node');
  $this
    ->assertNoText('Active context: testcontext');
}