You are here

abstract public function PublishContentWebTestBase::assertNodeOperationAccess in Publish Content 7

Perform a GET operation on a node.

This will check the response to access some operation via the URL of a node. In the case of 'publish' or 'unpublish' it will first visit the view of a node so that the relevant tabs can be generated.

Parameters

int $nid: The node nid

string $op: An operation such as 'view', 'edit', 'publish', 'unpublish'

int $expected_response: The expexted response code. If the user should not be able to see the 'publish' or 'unpublish' tabs, set this to 403, otherwise 200.

string $msg: (optional) An assertion log message.

6 calls to PublishContentWebTestBase::assertNodeOperationAccess()
PublishContentWebTestBase::assertCurrentUserCannotPublish in tests/publishcontent.test
Check the current user session forbids publish of a given node.
PublishContentWebTestBase::assertCurrentUserCannotUnpublish in tests/publishcontent.test
Check the current user session cannot unpublish a given node.
PublishContentWebTestBase::assertCurrentUserCanPublish in tests/publishcontent.test
Check the current user session can publish a given node.
PublishContentWebTestBase::assertCurrentUserCanUnpublish in tests/publishcontent.test
Check the current user session can unpublish a node.
PublishContentWebTestBase::testNoPermissionAndNotOwner in tests/publishcontent.test
Check publishcontent module does not interfere with the normal Drupal.

... See full list

3 methods override PublishContentWebTestBase::assertNodeOperationAccess()
PublishContentButtonTests::assertNodeOperationAccess in tests/publishcontent.test
Perform a GET operation on a node.
PublishContentCheckboxTests::assertNodeOperationAccess in tests/publishcontent.test
Perform a GET operation on a node.
PublishContentTabTests::assertNodeOperationAccess in tests/publishcontent.test
Perform a GET operation on a node.

File

tests/publishcontent.test, line 33
Unit tests for Publish Content module.

Class

PublishContentWebTestBase
We test to ensure we are not messing up with the default Drupal access for view node i.e. a owner of a node can view it even if unpublished.

Code

public abstract function assertNodeOperationAccess($nid, $op, $expected_response, $msg = '');