function ContentCrudTestCase::assertNodeMissingFields in Content Construction Kit (CCK) 6.3
Same name and namespace in other branches
- 6 tests/content.crud.test \ContentCrudTestCase::assertNodeMissingFields()
- 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()
File
- tests/
content.crud.test, line 204
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,
)));
}
}