You are here

protected function ContentLoaderTestBase::createContentTestFile in YAML Content 8

Create a test file with specified contents for testing.

Parameters

string $filename: The name of the test file to be created.

string $contents: The contents to populate into the test file.

Return value

$this

1 call to ContentLoaderTestBase::createContentTestFile()
ContentLoaderTest::testEmptyContentFile in tests/src/Unit/ContentLoader/ContentLoaderTest.php
Tests the correct return value when parsing an empty file.

File

tests/src/Unit/ContentLoader/ContentLoaderTestBase.php, line 55

Class

ContentLoaderTestBase
Base test class for all ContentLoader testing.

Namespace

Drupal\Tests\yaml_content\Unit\ContentLoader

Code

protected function createContentTestFile($filename, $contents) {
  vfsStream::newFile($filename)
    ->withContent($contents)
    ->at($this->root
    ->getChild('content'));
  return $this;
}