You are here

public function DevelDumperTestTrait::assertDumpExportEquals in Devel 8.2

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

Assertion for ensure dump content.

Asserts that the string passed in input is equals to the string representation of a variable obtained exporting the data.

Use \Drupal\devel\DevelDumperManager::export().

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.

1 call to DevelDumperTestTrait::assertDumpExportEquals()
DevelTwigExtensionTest::testDumpFunctions in tests/src/Kernel/DevelTwigExtensionTest.php
Tests that the Twig extension's dump functions produce the expected output.

File

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

Class

DevelDumperTestTrait
Provides a class for checking dumper output.

Namespace

Drupal\Tests\devel\Kernel

Code

public function assertDumpExportEquals($dump, $data, $name = NULL, $message = '') {
  $output = $this
    ->getDumperExportDump($data, $name);
  $this
    ->assertEquals(rtrim($dump), $output, $message);
}