You are here

protected function DrushCommandsGeneratorTest::setUp in Migrate Tools 8.5

Overrides BrowserTestBase::setUp

File

tests/src/Functional/DrushCommandsGeneratorTest.php, line 45

Class

DrushCommandsGeneratorTest
Execute drush on fully functional website using source generators.

Namespace

Drupal\Tests\migrate_tools\Functional

Code

protected function setUp() : void {
  parent::setUp();

  // Setup the file system so we create the source CSV.
  $this->container
    ->get('stream_wrapper_manager')
    ->registerWrapper('public', PublicStream::class, StreamWrapperInterface::NORMAL);
  $fs = \Drupal::service('file_system');
  $fs
    ->mkdir('public://sites/default/files', NULL, TRUE);

  // The source data for this test.
  $this->sourceData = <<<'EOD'
vid,name,description,hierarchy,weight
tags,Tags,Use tags to group articles,0,0
forums,Sujet de discussion,Forum navigation vocabulary,1,0
test_vocabulary,Test Vocabulary,This is the vocabulary description,1,0
genre,Genre,Genre description,1,0
EOD;

  // Write the data to the filepath given in the test migration.
  file_put_contents('public://test.csv', $this->sourceData);
}