You are here

function ContextUiTestCase::testCreateContext in Context 6.3

Same name and namespace in other branches
  1. 6 context_ui/tests/context_ui.test \ContextUiTestCase::testCreateContext()
  2. 6.2 context_ui/tests/context_ui.test \ContextUiTestCase::testCreateContext()
  3. 7.3 context_ui/tests/context_ui.test \ContextUiTestCase::testCreateContext()

File

context_ui/tests/context_ui.test, line 31

Class

ContextUiTestCase
Functional Test for Context UI

Code

function testCreateContext() {

  // Create context
  $context = new stdClass();
  $context->name = strtolower($this
    ->randomName(15));
  $context->description = strtolower($this
    ->randomName(15));
  $context->tag = strtolower($this
    ->randomName(15));
  $this->context = $context;
  $edit = array(
    'name' => $context->name,
    'description' => $context->description,
    'tag' => $context->tag,
    'conditions[plugins][node][values][page]' => 'page',
    'reactions[plugins][menu]' => 'node/add/page',
  );
  $this
    ->drupalPost('admin/build/context/add', $edit, 'Save');
  $this
    ->assertText($context->name . ' has been created.', 'Context saved.');
}