function ContextUiTestCase::testCreateContext in Context 6.2
Same name and namespace in other branches
- 6.3 context_ui/tests/context_ui.test \ContextUiTestCase::testCreateContext()
- 6 context_ui/tests/context_ui.test \ContextUiTestCase::testCreateContext()
- 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->namespace = strtolower($this
->randomName(15));
$context->attribute = strtolower($this
->randomName(15));
$context->value = strtolower($this
->randomName(15));
$this->context = $context;
$edit = array(
'namespace' => $context->namespace,
'attribute' => $context->attribute,
'value' => $context->value,
'items[node][page]' => 'page',
'items[menu]' => 'node/add/page',
);
$this
->drupalPost('admin/build/context/add', $edit, 'Save');
$this
->assertRaw(t('The context %title was saved successfully.', array(
'%title' => $edit['value'],
)), 'Context saved.');
}