Commit 6b17f09e authored by webchick's avatar webchick

Issue #1812732 by xjm, tim.plunkett: Use constants instead of integers in...

Issue #1812732 by xjm, tim.plunkett: Use constants instead of integers in drupalCreateNode() and improve its documentation.
parent 5a71644a
......@@ -228,7 +228,6 @@ protected function drupalCreateNode(array $settings = array()) {
$settings += array(
'body' => array(LANGUAGE_NOT_SPECIFIED => array(array())),
'title' => $this->randomName(8),
'comment' => COMMENT_NODE_OPEN,
'changed' => REQUEST_TIME,
'promote' => NODE_NOT_PROMOTED,
'revision' => 1,
......@@ -239,6 +238,13 @@ protected function drupalCreateNode(array $settings = array()) {
'langcode' => LANGUAGE_NOT_SPECIFIED,
);
// Add in comment settings for nodes.
if (module_exists('comment')) {
$settings += array(
'comment' => COMMENT_NODE_OPEN,
);
}
// Use the original node's created time for existing nodes.
if (isset($settings['created']) && !isset($settings['date'])) {
$settings['date'] = format_date($settings['created'], 'custom', 'Y-m-d H:i:s O');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment