You are here

function ContentCrudTestCase::assertNodeMissingFields in Content Construction Kit (CCK) 6

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

Checks that the output from node_load is missing certain fields

Parameters

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

$fields Array containing a list of field names:

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

File

tests/content.crud.test, line 187

Class

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

Code

function assertNodeMissingFields($node, $fields) {
  if (is_numeric($node) && isset($this->nodes[$node])) {
    $node = $this->nodes[$node];
  }
  $node = (array) node_load($node->nid, NULL, TRUE);
  foreach ($fields as $field) {
    $this
      ->assertFalse(isset($node[$field]), t('Node should be lacking field !key', array(
      '!key' => $field,
    )));
  }
}