You are here

public function PublishContentWebTestBase::assertCannotPublishFromLinksPage in Publish Content 7

Assert the current user cannot publish a node from the listing test page.

1 call to PublishContentWebTestBase::assertCannotPublishFromLinksPage()
PublishContentWebTestBase::testBasicPublishCallback in tests/publishcontent.test
Test basic publish ability using the publishcontent_test module.

File

tests/publishcontent.test, line 180
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 assertCannotPublishFromLinksPage($node) {
  $status = $node->status;
  $this
    ->setNodeStatus($node, 0, 'Start test with an unpublished node');
  $this
    ->drupalGet('publishcontent-links');
  $this
    ->assertResponse(200);
  $this
    ->assertNoLink('publish-' . $node->nid);
  $this
    ->assertNoLink('unpublish-' . $node->nid);
  $this
    ->setNodeStatus($node, $status, 'Reset status');
}