You are here

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

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

Checks that the output from node_load matches the expected values.

Parameters

$node Either a node object, or the index of an acquired node (only the nid field is used):

$values Array of values to check against node_load. The node object must contain the keys in the array,: and the values must be equal, but the node object may also contain other keys.

3 calls to ContentCrudTestCase::assertNodeValues()
ContentCrudMultipleToSingleTest::testMultipleToSingle in tests/content.crud.test
ContentCrudSingleToMultipleTest::testSingleToMultiple in tests/content.crud.test
ContentCrudTestCase::assertNodeSaveValues in tests/content.crud.test
Checks that after a node is saved using node_save, the values to be saved match up with the output from node_load.

File

tests/content.crud.test, line 191

Class

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

Code

function assertNodeValues($node, $values) {
  if (is_numeric($node) && isset($this->nodes[$node])) {
    $node = $this->nodes[$node];
  }
  $node = node_load($node->nid, NULL, TRUE);
  $this
    ->_compareArrayForChanges($values, (array) $node, 'Node data [!key] is correct');
}