function DebugDump::getDumps

Retrieves dumps from storage.

Return value

array{string, array{file: string|null, line: int|null, dump: string[]}} Caller information.

5 calls to DebugDump::getDumps()
BrowserTestBaseTest::testVarDump in core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
Tests the dump() function provided by the var-dumper Symfony component.
DebugDump::testRunnerFinished in core/tests/Drupal/TestTools/Extension/Dump/DebugDump.php
Prints the dumps generated during the test.
KernelTestBaseTest::testVarDump in core/tests/Drupal/KernelTests/KernelTestBaseTest.php
Tests the dump() function provided by the var-dumper Symfony component.
UnitTestCaseTest::testVarDumpSameProcess in core/tests/Drupal/Tests/UnitTestCaseTest.php
Tests the dump() function in a test run in the same process.
UnitTestCaseTest::testVarDumpSeparateProcess in core/tests/Drupal/Tests/UnitTestCaseTest.php
Tests the dump() function in a test run in a separate process.

File

core/tests/Drupal/TestTools/Extension/Dump/DebugDump.php, line 183

Class

DebugDump
Drupal's extension for printing dump() output results.

Namespace

Drupal\TestTools\Extension\Dump

Code

public static function getDumps() : array {
    if (!self::isEnabled()) {
        return [];
    }
    $config = (array) json_decode(getenv('DRUPAL_PHPUNIT_DUMPER_CONFIG'));
    $contents = rtrim(file_get_contents($config['stagingFilePath']));
    if (empty($contents)) {
        return [];
    }
    $encodedDumps = explode("\n", $contents);
    $dumps = [];
    foreach ($encodedDumps as $encodedDump) {
        $dump = self::decodeDump($encodedDump);
        $test = $dump['test'];
        unset($dump['test']);
        $dumps[$test][] = $dump;
    }
    return $dumps;
}

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