You are here

public function MetatagTestBase::createContentType in Metatag 7

Create a content type for the tests.

Parameters

string $machine_name: The machine name of a content type to create.

string $label: The human-readable name of the content type.

Return value

array The content type definition.

6 calls to MetatagTestBase::createContentType()
MetatagContextTest::setUp in metatag_context/tests/MetatagContextTest.test
Sets up a Drupal site for running functional and integration tests.
MetatagCoreLocaleTest::testNodeFormTranslations in tests/MetatagCoreLocaleTest.test
Test that the node form meta tag fields are translated correctly.
MetatagCoreNodeTest::testEntityCreationWorkflow in tests/MetatagCoreNodeTest.test
Tests creation of a standard entity.
MetatagCoreTermTest::testEntityCreationWorkflow in tests/MetatagCoreTermTest.test
Tests creation of a standard entity.
MetatagCoreWithPanelsTest::testPanelsNodeView in tests/MetatagCoreWithPanelsTest.test
Test out a node_view Panels display with Metatag.

... See full list

File

tests/MetatagTestBase.test, line 81
A base class for the Metatag tests, provides shared methods.

Class

MetatagTestBase
A base class for the Metatag tests, provides shared methods.

Code

public function createContentType($machine_name, $label) {

  // Create a content type.
  $content_type = $this
    ->drupalCreateContentType(array(
    'type' => $machine_name,
    'name' => $label,
  ));

  // Enable meta tags for this new content type.
  metatag_entity_type_enable('node', $machine_name, TRUE);
  return $content_type;
}