You are here

public function PublishContentWebTestBase::assertNodeStatus in Publish Content 7

Assert the status of a given node.

Parameters

int $nid: The node nid to check

int $status: Either 1 for published or 0 for unpublished

6 calls to PublishContentWebTestBase::assertNodeStatus()
PublishContentWebTestBase::assertCanPublishFromLinksPage in tests/publishcontent.test
Assert the current user can publish a node from the listing test page.
PublishContentWebTestBase::assertCanUnpublishFromLinksPage in tests/publishcontent.test
Assert the current user can unpublish a node from the listing test page.
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.

... See full list

File

tests/publishcontent.test, line 59
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 function assertNodeStatus($nid, $status, $msg = '') {
  $node = node_load($nid, NULL, TRUE);
  $msg = !empty($msg) ? $msg : t('Node status is @actual, expecting @expected', array(
    '@actual' => $node->status,
    '@expected' => $status,
  ));
  $this
    ->assertEqual($node->status, $status, $msg);
}