You are here

private function OverrideNodeOptionsTest::assertNodeFieldsNoAccess in Override Node Options 7

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

Parameters

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

array $fields: An array of form fields to check.

3 calls to OverrideNodeOptionsTest::assertNodeFieldsNoAccess()
OverrideNodeOptionsTest::testNodeAuthor in src/Tests/Functional/OverrideNodeOptionsTest.php
Test the 'Authoring information' fieldset.
OverrideNodeOptionsTest::testNodeOptions in src/Tests/Functional/OverrideNodeOptionsTest.php
Test the 'Authoring information' fieldset.
OverrideNodeOptionsTest::testNodeRevisions in src/Tests/Functional/OverrideNodeOptionsTest.php
Test the 'Revision information' fieldset.

File

src/Tests/Functional/OverrideNodeOptionsTest.php, line 83
Unit tests for the override_node_options module.

Class

OverrideNodeOptionsTest
Defines a base class for testing the Override Node Options module.

Namespace

Drupal\override_node_options\Tests\Functional

Code

private 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);
  }
}