private function DevelDumperTestTrait::getDumperDump in Devel 8.3
Same name and namespace in other branches
- 8 tests/src/Kernel/DevelDumperTestTrait.php \Drupal\Tests\devel\Kernel\DevelDumperTestTrait::getDumperDump()
- 8.2 tests/src/Kernel/DevelDumperTestTrait.php \Drupal\Tests\devel\Kernel\DevelDumperTestTrait::getDumperDump()
- 4.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\KernelCode
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);
}