function NodesInBlock::_createNode in Nodes In Block 6
Helper function to create a node with standard settings.
1 call to NodesInBlock::_createNode()
- NodesInBlock::testNodeSubmissions in ./
nodesinblock.test - Test submitting of nodes and see if they appear in blocks and how they are rendered.
File
- ./
nodesinblock.test, line 73 - Tests for Nodes in block
Class
- NodesInBlock
- @file Tests for Nodes in block
Code
function _createNode($type, $nid = 1, $region = 0, $vis = '*') {
$edit = array(
'title' => 'Title ' . $nid,
'body' => 'Text ' . $nid,
'nodesinblock_delta' => $region,
'nodesinblock_visibility' => $vis,
'nodesinblock_render' => NIB_RENDER_PAGE_WITH_LINKS,
);
$this
->drupalPost('node/add/' . $type, $edit, t('Save'));
$result = db_result(db_query("SELECT nid FROM {nodesinblock} WHERE nid = %d", $nid));
$this
->assertTrue($result, 'Node ' . $nid . ' saved in nodesinblock table', 'Node submission');
}