You are here

public function PublishContentWebTestBase::assertCannotUnpublishFromLinksPage in Publish Content 7

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

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

File

tests/publishcontent.test, line 214
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 assertCannotUnpublishFromLinksPage($node) {
  $status = $node->status;
  $this
    ->setNodeStatus($node, 1, 'Start test with a published node');
  $this
    ->drupalGet('publishcontent-links');
  $this
    ->assertResponse(200);
  $this
    ->assertNoLink('publish-' . $node->nid);
  $this
    ->assertNoLink('unpublish-' . $node->nid);
  $this
    ->setNodeStatus($node, $status, 'Reset status');
}