You are here

public function BuildTestTest::testWorkspace in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php \Drupal\BuildTests\Framework\Tests\BuildTestTest::testWorkspace()

Ensure that workspaces work.

File

core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php, line 19

Class

BuildTestTest
@coversDefaultClass \Drupal\BuildTests\Framework\BuildTestBase @group Build

Namespace

Drupal\BuildTests\Framework\Tests

Code

public function testWorkspace() {
  $test_directory = 'test_directory';

  // Execute an empty command through the shell to build out a working
  // directory.
  $process = $this
    ->executeCommand('', $test_directory);
  $this
    ->assertCommandSuccessful();

  // Assert that our working directory exists and is in use by the process.
  $workspace = $this
    ->getWorkspaceDirectory();
  $working_path = $workspace . '/' . $test_directory;
  $this
    ->assertDirectoryExists($working_path);
  $this
    ->assertEquals($working_path, $process
    ->getWorkingDirectory());
}