You are here

function OverrideNodeOptionsTestCase::assertNodeFieldsNoAccess in Override Node Options 6

Same name and namespace in other branches
  1. 8 override_node_options.test \OverrideNodeOptionsTestCase::assertNodeFieldsNoAccess()

Assert that the user cannot access fields on node add and edit forms.

Parameters

$node: The node object, will be used on the node edit form.

$fields: An array of form fields to check.

3 calls to OverrideNodeOptionsTestCase::assertNodeFieldsNoAccess()
OverrideNodeOptionsTestCase::testNodeAuthor in ./override_node_options.test
Test the 'Authoring information' fieldset.
OverrideNodeOptionsTestCase::testNodeOptions in ./override_node_options.test
Test the 'Authoring information' fieldset.
OverrideNodeOptionsTestCase::testNodeRevisions in ./override_node_options.test
Test the 'Revision information' fieldset.

File

./override_node_options.test, line 52
Unit tests for the override_node_options module.

Class

OverrideNodeOptionsTestCase
@file Unit tests for the override_node_options module.

Code

function assertNodeFieldsNoAccess(stdClass $node, array $fields) {
  $this
    ->drupalGet('node/add/' . $node->type);
  foreach ($fields as $field) {
    $this
      ->assertNoFieldByName($field);
  }
  $this
    ->drupalGet('node/' . $this->node->nid . '/edit');
  foreach ($fields as $field) {
    $this
      ->assertNoFieldByName($field);
  }
}