You are here

protected function PMPAPIPullWebTestCase::createContentType in Public Media Platform API Integration 7

Creates a new content type.

Parameters

$instances: Any instances to be added to the content type.

7 calls to PMPAPIPullWebTestCase::createContentType()
PMPAPIPullWebTestCase::testPmpAPIEmbargoedThenValid in pmpapi_pull/tests/pmpapi_pull.test
Checks that node is published when it becomes valid.
PMPAPIPullWebTestCase::testPmpAPIPullEmbargoedStory in pmpapi_pull/tests/pmpapi_pull.test
Checks for status = 0 on pulled embargoed story.
PMPAPIPullWebTestCase::testPmpAPIPullExpiredStory in pmpapi_pull/tests/pmpapi_pull.test
Checks for status = 0 on pulled expired story.
PMPAPIPullWebTestCase::testPmpAPIPullPullStory in pmpapi_pull/tests/pmpapi_pull.test
Pulls a story doc from the PMP and maps it to a node.
PMPAPIPullWebTestCase::testPmpAPIPullPullStoryWithImage in pmpapi_pull/tests/pmpapi_pull.test
Pulls a story doc (with attached image) from the PMP and maps it to a node.

... See full list

File

pmpapi_pull/tests/pmpapi_pull.test, line 274

Class

PMPAPIPullWebTestCase
Tests the functionality of the PMPAPI pull module.

Code

protected function createContentType($instances = array()) {
  $content_type = $this
    ->drupalCreateContentType(array(
    'type' => $this->nodetype,
  ));
  if (!empty($instances)) {
    foreach ($instances as $instance) {
      $instance['entity_type'] = 'node';
      $instance['bundle'] = $this->nodetype;
      field_create_instance($instance);
    }
  }
  return $content_type;
}