public function ProtectedNodeGlobalPassword::createProtectedNode in Protected Node 1.0.x
Same name and namespace in other branches
- 7 tests/protected_node.global.test \ProtectedNodeGlobalPassword::createProtectedNode()
Helper method to create a protected node.
Please make sure the user has the permission to create the node before calling the method.
Return value
object A node object.
3 calls to ProtectedNodeGlobalPassword::createProtectedNode()
- ProtectedNodeGlobalPassword::testAllowedView in tests/
protected_node.global.test - Test function.
- ProtectedNodeGlobalPassword::testAllowedViewWrongPassword in tests/
protected_node.global.test - Test function.
- ProtectedNodeGlobalPassword::testAuthenticatedNonAllowedView in tests/
protected_node.global.test - Test function.
File
- tests/
protected_node.global.test, line 129 - Test protected node global password functionality.
Class
- ProtectedNodeGlobalPassword
- Configure protected_node to use global password.
Code
public function createProtectedNode() {
// Add a new page node that is protected.
$node_title = $this
->randomName(8);
$node_data = array(
'title' => $node_title,
'body[und][0][value]' => $this
->randomName(32),
'protected_node_is_protected' => TRUE,
);
$this
->drupalPost('node/add/page', $node_data, t('Save'));
return $this
->drupalGetNodeByTitle($node_title);
}