You are here

private function DevelDumperTestTrait::getDumperExportDump in Devel 8

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/DevelDumperTestTrait.php \Drupal\Tests\devel\Kernel\DevelDumperTestTrait::getDumperExportDump()
  2. 8.2 tests/src/Kernel/DevelDumperTestTrait.php \Drupal\Tests\devel\Kernel\DevelDumperTestTrait::getDumperExportDump()
  3. 4.x tests/src/Kernel/DevelDumperTestTrait.php \Drupal\Tests\devel\Kernel\DevelDumperTestTrait::getDumperExportDump()

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::export()

2 calls to DevelDumperTestTrait::getDumperExportDump()
DevelDumperTestTrait::assertContainsDumpExport in tests/src/Kernel/DevelDumperTestTrait.php
Asserts that a haystack contains the dump export output.
DevelDumperTestTrait::assertDumpExportEquals in tests/src/Kernel/DevelDumperTestTrait.php
Asserts that the string passed in input is equals to the string representation of a variable obtained exporting the data.

File

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

Class

DevelDumperTestTrait
Provides a class for checking dumper output.

Namespace

Drupal\Tests\devel\Kernel

Code

private function getDumperExportDump($input, $name = NULL) {
  $output = \Drupal::service('devel.dumper')
    ->export($input, $name);
  return rtrim($output);
}