function FilesTestTrait::projectPathname

Gets the absolute pathname for a project directory.

Parameters

string $directory: The directory to check. If no directory name is passed, it will return the absolute path for the directory containing the Examples project.

Return value

string The absolute pathname.

4 calls to FilesTestTrait::projectPathname()
ConfigFilesValidationTest::providerConfigFiles in tests/src/Unit/ConfigFilesValidationTest.php
Provides test data for testNoUuidInConfig().
RoutePathTest::providerRoutingFiles in tests/src/Unit/RoutePathTest.php
Provides test data for testPathStartsWithSlash().
TraitsTest::providerConfigFiles in tests/src/Unit/TraitsTest.php
Provides test data for testNoUuidInConfig().
TraitsTest::providerRoutingFiles in tests/src/Unit/TraitsTest.php
Provides test data for testRoutingFilesCallback().

File

tests/src/Unit/FilesTestTrait.php, line 20

Class

FilesTestTrait
Trait for tests that retrieve files in project directories.

Namespace

Drupal\Tests\examples\Unit

Code

protected static function projectPathname(string $directory = '') : string {
  // There is no need to use realpath() because __DIR__ is always an absolute
  // path.
  return dirname(__DIR__, 3) . "/{$directory}";
}