function DevelDumperTestTrait::assertDumpEquals

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

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

$dump: The string that contains the dump output to test.

$data: The variable to dump.

null $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 64

Class

DevelDumperTestTrait
Provides a class for checking dumper output.

Namespace

Drupal\Tests\devel\Kernel

Code

public function assertDumpEquals($dump, $data, $name = NULL, $message = '') {
    $output = $this->getDumperDump($data, $name);
    $this->assertEqual(rtrim($dump), $output, $message);
}