You are here

function PublishContentWebCaseTest::testNoPermissionAndNotOwner in Publish Content 5.2

Same name and namespace in other branches
  1. 6 tests/publishcontent.test \PublishContentWebCaseTest::testNoPermissionAndNotOwner()

File

tests/publishcontent.test, line 136
Unit tests for Publish Content module. prerequesite: make sure that 'authenticated user' does not have any access like 'publish [content type] content' or 'unpublish [content type] content'

Class

PublishContentWebCaseTest
@file Unit tests for Publish Content module. prerequesite: make sure that 'authenticated user' does not have any access like 'publish [content type] content' or 'unpublish [content type] content'

Code

function testNoPermissionAndNotOwner() {
  $node = $this
    ->drupalCreateNode(array(
    'type' => 'page',
    'uid' => 0,
    'status' => 1,
  ));
  $this
    ->drupalLoginUser($this
    ->drupalCreateUserRolePerm());
  $this
    ->assert_current_user_cannot_publish_node($node);
  $this
    ->assert_current_user_cannot_unpublish_node($node);
}