You are here

protected function ClassifiedTestAbstractTest::createNode in Classified Ads 7.3

Build a node from settings, providing classified-specific defaults.

Parameters

array $settings: Array of non-default ad properties and fields, overriding defaults provided in this function.

Return value

object The new node, reloaded from DB.

6 calls to ClassifiedTestAbstractTest::createNode()
ClassifiedTestNotificationsTest::test1441396 in tests/classified_test_notifications.test
Issue #1441396.
ClassifiedTestTestBasicTest::test0123396And0143680 in tests/classified_test_basic.test
Bug 123396: Unchecking Publish doesn't prevent nodes from being published.
ClassifiedTestTestBasicTest::test1287674 in tests/classified_test_basic.test
Bug 1287674.
ClassifiedTestTestBasicTest::test1432606 in tests/classified_test_basic.test
Bug 1432606: Ads can be viewed when not published.
ClassifiedTestTestBasicTest::test1491880 in tests/classified_test_basic.test
Test token generation for issue #1491880.

... See full list

File

tests/classified_test_abstract.test, line 54

Class

ClassifiedTestAbstractTest
Base class to Test known fixed bugs to catch regressions.

Code

protected function createNode(array $settings) {
  $category_field_name = _classified_get('field-category');
  $settings += array(
    'title' => $this
      ->randomString(10),
    'body' => array(
      LANGUAGE_NONE => array(
        0 => array(
          'value' => $this
            ->randomString(40),
        ),
      ),
    ),
    'type' => 'classified',
    $category_field_name => array(),
    'status' => 1,
  );
  $node = $this
    ->drupalCreateNode($settings);

  // Taxonomy is not in the same format as right after creation.
  $node = node_load($node->nid, NULL, TRUE);
  return $node;
}