You are here

function ContentCrudTestCase::assertNodeSaveValues in Content Construction Kit (CCK) 6.3

Same name and namespace in other branches
  1. 6 tests/content.crud.test \ContentCrudTestCase::assertNodeSaveValues()
  2. 6.2 tests/content.crud.test \ContentCrudTestCase::assertNodeSaveValues()

Checks that after a node is saved using node_save, the values to be saved match up with the output from node_load.

Parameters

$node Either a node object, or the index of an acquired node:

$values Array of values to be merged with the node and passed to node_save:

Return value

The values array

2 calls to ContentCrudTestCase::assertNodeSaveValues()
ContentCrudMultipleToSingleTest::testMultipleToSingle in tests/content.crud.test
ContentCrudSingleToMultipleTest::testSingleToMultiple in tests/content.crud.test

File

tests/content.crud.test, line 174

Class

ContentCrudTestCase
Base class for CCK CRUD tests. Defines many helper functions useful for writing CCK CRUD tests.

Code

function assertNodeSaveValues($node, $values) {
  if (is_numeric($node) && isset($this->nodes[$node])) {
    $node = $this->nodes[$node];
  }
  $node = $values + (array) $node;
  $node = (object) $node;
  node_save($node);
  $this
    ->assertNodeValues($node, $values);
  return $values;
}