function PublishContentWebCaseTest::assert_current_user_can_unpublish_node in Publish Content 6
Same name and namespace in other branches
- 5.2 tests/publishcontent.test \PublishContentWebCaseTest::assert_current_user_can_unpublish_node()
2 calls to PublishContentWebCaseTest::assert_current_user_can_unpublish_node()
File
- tests/
publishcontent.test, line 102 - 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 assert_current_user_can_unpublish_node(&$node) {
$this
->assertEqual($node->status, 1, 'pre-requesite: status MUST be 1');
$this
->publishcontent_do_operation($node->nid, 'unpublish', 0, 'node should be published');
$this
->assertText(_publishcontent_get_message($node->nid, $node->title, FALSE), 'drupal_set_message not working for unpublish.');
$this
->assert_access_node($node, 'node MUST BE viewable even if unpublished');
$this
->publishcontent_do_operation($node->nid, 'unpublish', 0, 'node should be still unpublished');
$this
->set_node_status($node, 1, 'post-requesite: status MUST be 1');
}