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. 10 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 <a href="/api/drupal/core%21tests%21Drupal%21BuildTests%21Framework%21BuildTestBase.php/class/BuildTestBase/11.x" title="Provides a workspace to test build processes." class="local">\Drupal\BuildTests\Framework\BuildTestBase</a> @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.