function DevelDumperTestTrait::getDumperDump

Same name in other branches
  1. 8.x-1.x tests/src/Kernel/DevelDumperTestTrait.php \Drupal\Tests\devel\Kernel\DevelDumperTestTrait::getDumperDump()
  2. 5.x tests/src/Kernel/DevelDumperTestTrait.php \Drupal\Tests\devel\Kernel\DevelDumperTestTrait::getDumperDump()

Returns a string representation of a variable.

Parameters

mixed $input: The variable to dump.

string $name: (optional) The label to output before variable, defaults to NULL.

Return value

string String representation of a variable.

See also

\Drupal\devel\DevelDumperManager::dump()

2 calls to DevelDumperTestTrait::getDumperDump()
DevelDumperTestTrait::assertContainsDump in tests/src/Kernel/DevelDumperTestTrait.php
Asserts that a haystack contains the dump output.
DevelDumperTestTrait::assertDumpEquals in tests/src/Kernel/DevelDumperTestTrait.php
Assertion for ensure dump content.

File

tests/src/Kernel/DevelDumperTestTrait.php, line 125

Class

DevelDumperTestTrait
Provides a class for checking dumper output.

Namespace

Drupal\Tests\devel\Kernel

Code

private function getDumperDump($input, $name = NULL) {
    ob_start();
    \Drupal::service('devel.dumper')->dump($input, $name);
    $output = ob_get_contents();
    ob_end_clean();
    return rtrim($output);
}