You are here

function ContentCrudTestCase::acquireContentTypes in Content Construction Kit (CCK) 6.3

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

Creates a number of content types with predictable names (simpletest_t1 ... simpletest_tN) These content types can later be accessed via $this->content_types[0 ... N-1]

Parameters

$count Number of content types to create:

6 calls to ContentCrudTestCase::acquireContentTypes()
ContentCrudBasicTest::setUp in tests/content.crud.test
Enable CCK, Text, and Schema modules.
ContentCrudMultipleToSingleTest::setUp in tests/content.crud.test
Enable CCK, Text, and Schema modules.
ContentCrudSingleToMultipleTest::setUp in tests/content.crud.test
Enable CCK, Text, and Schema modules.
ContentEmptyDeltaTest::setUp in tests/content.crud.test
Enable CCK, Text, and Schema modules.
ContentOptionWidgetTest::setUp in tests/content.crud.test
Enable CCK, Text, and Schema modules.

... See full list

File

tests/content.crud.test, line 252

Class

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

Code

function acquireContentTypes($count) {
  $this->content_types = array();
  for ($i = 0; $i < $count; $i++) {
    $name = 'simpletest_t' . ($i + 1);
    $this->content_types[$i] = $this
      ->drupalCreateContentType(array(
      'name' => $name,
      'type' => $name,
    ));
  }
  content_clear_type_cache();
}