Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Returns a parent directory's path
<?php dirname(string $path, int $levels = 1): string
<?php $bootPest = (static function (): void {

    $workerArgv = new ArgvInput();



    $rootPath = dirname(PHPUNIT_COMPOSER_INSTALL, 2);

    $testSuite = TestSuite::getInstance($rootPath, $workerArgv->getParameterOption(

        '--test-directory',

        'tests'
<?php     ]);



    $composerAutoloadFiles = [

        dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'autoload.php',

        dirname(__DIR__, 2).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php',

        dirname(__DIR__).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php',

    ];
<?php     $composerAutoloadFiles = [

        dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'autoload.php',

        dirname(__DIR__, 2).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php',

        dirname(__DIR__).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php',

    ];
<?php     $composerAutoloadFiles = [

        dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'autoload.php',

        dirname(__DIR__, 2).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php',

        dirname(__DIR__).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php',

    ];



    foreach ($composerAutoloadFiles as $file) {
<?php     public function persist(): void

    {

        if (! Filesystem::createDirectory(dirname($this->cacheFilename))) {

            throw new DirectoryCannotBeCreatedException($this->cacheFilename);

        }
<?php     public function boot(): void

    {

        $baseDirectory = dirname(__DIR__, 2);



        foreach (self::EXCLUDE_LIST as $directory) {

            ExcludeList::addDirectory($baseDirectory.DIRECTORY_SEPARATOR.$directory);
<?php             $basename = substr($basename, 0, $dotPos);

        }



        $relativePath = dirname(ucfirst($relativePath)).DIRECTORY_SEPARATOR.$basename;



        $relativePath = str_replace(DIRECTORY_SEPARATOR, '\\', $relativePath);
<?php             return str_starts_with($path, $startChar)

                ? $path

                : implode(DIRECTORY_SEPARATOR, [

                    dirname($this->filename),

                    $path,

                ]);

        }, $targets);
<?php                 continue;

            }



            if (! is_dir(dirname($toPath))) {

                mkdir(dirname($toPath));

            }
<?php             }



            if (! is_dir(dirname($toPath))) {

                mkdir(dirname($toPath));

            }



            copy($fromPath, $toPath);
<?php         $this->timer = new Timer();



        $wrapper = realpath(

            dirname(__DIR__, 4).DIRECTORY_SEPARATOR.'bin'.DIRECTORY_SEPARATOR.'worker.php',

        );

        assert($wrapper !== false);

        $phpFinder = new PhpExecutableFinder();
<?php     public function run(): int

    {

        $directory = dirname(__DIR__);

        assert($directory !== '');

        ExcludeList::addDirectory($directory);

        TestResultFacade::init();
<?php             throw ShouldNotHappen::fromMessage('Snapshot file could not be read.');

        }



        $snapshot = str_replace(dirname($this->testsPath).'/', '', $snapshotFilename);



        return [$snapshot, $contents];

    }
<?php     {

        $snapshotFilename = $this->getSnapshotFilename();



        if (! file_exists(dirname($snapshotFilename))) {

            mkdir(dirname($snapshotFilename), 0755, true);

        }
<?php         $snapshotFilename = $this->getSnapshotFilename();



        if (! file_exists(dirname($snapshotFilename))) {

            mkdir(dirname($snapshotFilename), 0755, true);

        }



        file_put_contents($snapshotFilename, $snapshot);