You are here

public function NodeImportCreateTest::testImportCreateDefault in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/node/src/Tests/Config/NodeImportCreateTest.php \Drupal\node\Tests\Config\NodeImportCreateTest::testImportCreateDefault()

Tests creating a content type during default config import.

File

core/modules/node/src/Tests/Config/NodeImportCreateTest.php, line 42
Contains \Drupal\node\Tests\Config\NodeImportCreateTest.

Class

NodeImportCreateTest
Create content types during config create method invocation.

Namespace

Drupal\node\Tests\Config

Code

public function testImportCreateDefault() {
  $node_type_id = 'default';

  // Check that the content type does not exist yet.
  $this
    ->assertFalse(NodeType::load($node_type_id));

  // Enable node_test_config module and check that the content type
  // shipped in the module's default config is created.
  $this->container
    ->get('module_installer')
    ->install(array(
    'node_test_config',
  ));
  $node_type = NodeType::load($node_type_id);
  $this
    ->assertTrue($node_type, 'The default content type was created.');
}