function BuildTestTest::testWorkspace

Same name and namespace in other branches
  1. 9 core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php \Drupal\BuildTests\Framework\Tests\BuildTestTest::testWorkspace()
  2. 8.9.x core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php \Drupal\BuildTests\Framework\Tests\BuildTestTest::testWorkspace()
  3. 11.x 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 21

Class

BuildTestTest
@coversDefaultClass \Drupal\BuildTests\Framework\BuildTestBase[[api-linebreak]] @group Build

Namespace

Drupal\BuildTests\Framework\Tests

Code

public function testWorkspace() : void {
  $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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.