You are here

public function DefaultContentYamlImportTest::testImport in Default Content for D8 2.0.x

Test importing default content.

File

tests/src/Kernel/DefaultContentYamlImportTest.php, line 78

Class

DefaultContentYamlImportTest
Test import of default content.

Namespace

Drupal\Tests\default_content\Kernel

Code

public function testImport() {

  // Simulate an existing target file.
  file_put_contents('public://test-file.txt', 'exists');

  // Enable the module and import the content.
  \Drupal::service('module_installer')
    ->install([
    'default_content_test_yaml',
  ], TRUE);
  $this
    ->doPostInstallTests();
}