function OverrideNodeOptionsTestCase::testNodeOptions in Override Node Options 8
Same name and namespace in other branches
- 6 override_node_options.test \OverrideNodeOptionsTestCase::testNodeOptions()
Test the 'Authoring information' fieldset.
File
- ./
override_node_options.test, line 67 - Unit tests for the override_node_options module.
Class
- OverrideNodeOptionsTestCase
- @file Unit tests for the override_node_options module.
Code
function testNodeOptions() {
$this->admin_user = $this
->drupalCreateUser(array(
'create page content',
'edit any page content',
'override page published option',
'override page promote to front page option',
'override page sticky option',
));
$this
->drupalLogin($this->admin_user);
$fields = array(
'status' => (bool) (!$this->node->status),
'promote' => (bool) (!$this->node->promote),
'sticky' => (bool) (!$this->node->sticky),
);
$this
->drupalPost('node/' . $this->node->nid . '/edit', $fields, t('Save'));
$this
->assertNodeFieldsUpdated($this->node, $fields);
$this
->drupalLogin($this->normal_user);
$this
->assertNodeFieldsNoAccess($this->node, array_keys($fields));
}