'Context UI functional tests', 'description' => 'Create and save a context.', 'group' => 'Context UI', ); } function setUp() { parent::setUp('ctools', 'context', 'context_ui', 'blog'); // Create and login user $admin_user = $this->drupalCreateUser(array( 'access administration pages', 'administer site configuration', 'access content', 'create blog content' )); $this->drupalLogin($admin_user); } 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; $this->drupalGet('admin'); $this->drupalGet('admin/structure'); $this->drupalGet('admin/structure/context'); $edit = array( 'name' => $context->name, 'description' => $context->description, 'tag' => $context->tag, 'conditions[plugins][node][values][page]' => 'blog', 'reactions[plugins][menu]' => 'node/add/blog', ); $this->drupalPost('admin/structure/context/add', $edit, 'Save'); $this->assertText($context->name . ' has been created.', 'Context saved.'); } }