You are here

public function DefaultFieldComparatorWebTestCase::testNodeCreation in Changed Fields API 7.2

Same name and namespace in other branches
  1. 7.3 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 = array(
    'type' => 'article',
    'promote' => 1,
    'title' => $title,
    'body' => array(
      LANGUAGE_NONE => array(
        array(
          '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.');
}