public function DevelDumperTestTrait::assertDumpEquals in Devel 8.3
Same name and namespace in other branches
- 8 tests/src/Kernel/DevelDumperTestTrait.php \Drupal\Tests\devel\Kernel\DevelDumperTestTrait::assertDumpEquals()
- 8.2 tests/src/Kernel/DevelDumperTestTrait.php \Drupal\Tests\devel\Kernel\DevelDumperTestTrait::assertDumpEquals()
- 4.x tests/src/Kernel/DevelDumperTestTrait.php \Drupal\Tests\devel\Kernel\DevelDumperTestTrait::assertDumpEquals()
Assertion for ensure dump content.
Asserts that the string passed in input is equals to the string representation of a variable obtained dumping the data.
Use \Drupal\devel\DevelDumperManager::dump().
Parameters
string $dump: The string that contains the dump output to test.
mixed $data: The variable to dump.
string $name: (optional) The label to output before variable, defaults to NULL.
string $message: (optional) A message to display with the assertion.
File
- tests/
src/ Kernel/ DevelDumperTestTrait.php, line 70
Class
- DevelDumperTestTrait
- Provides a class for checking dumper output.
Namespace
Drupal\Tests\devel\KernelCode
public function assertDumpEquals($dump, $data, $name = NULL, $message = '') {
$output = $this
->getDumperDump($data, $name);
$this
->assertEquals(rtrim($dump), $output, $message);
}