1 node.test NodeEntityFieldQueryAlter::testNodeQueryAlterWithUI()

Tests that node access permissions are followed.

File

core/modules/node/tests/node.test, line 3303
Tests for node.module.

Class

NodeEntityFieldQueryAlter
Tests node_query_entity_field_access_alter().

Code

function testNodeQueryAlterWithUI() {
  // Verify that a user with access permission can see at least one node.
  $this->backdropLogin($this->accessUser);
  $this->backdropGet('node_access_entity_test_page');
  $this->assertText('Yes, 4 nodes', "4 nodes were found for access user");
  $this->assertNoText('Exception', "No database exception");

  // Verify that a user with no access permission cannot see nodes.
  $this->backdropLogin($this->noAccessUser);
  $this->backdropGet('node_access_entity_test_page');
  $this->assertText('No nodes', "No nodes were found for no access user");
  $this->assertNoText('Exception', "No database exception");
}