public function DefaultFieldComparatorWebTestCase::testNodeCreation in Changed Fields API 7.3
Same name and namespace in other branches
- 7.2 tests/default_field_comparator.test \DefaultFieldComparatorWebTestCase::testNodeCreation()
Check if API works correctly on node creation event.
API should not fire CFObserverInterface::update() after node creation.
File
- tests/
default_field_comparator.test, line 112 - Test default field comparator.
Class
- DefaultFieldComparatorWebTestCase
- Class DefaultFieldComparatorWebTestCase.
Code
public function testNodeCreation() {
$title = 'Title';
$settings = [
'type' => 'article',
'promote' => 1,
'title' => $title,
'body' => [
LANGUAGE_NONE => [
[
'value' => 'Body',
'format' => filter_default_format(),
'summary' => '',
],
],
],
];
$node = $this
->drupalCreateNode($settings);
$this
->assertEqual(!empty($node->changed_fields), FALSE, 'Fields were not changed after node creation.');
}