function DevelDumperTestTrait::assertContainsDump
Same name in other branches
- 4.x tests/src/Kernel/DevelDumperTestTrait.php \Drupal\Tests\devel\Kernel\DevelDumperTestTrait::assertContainsDump()
- 5.x tests/src/Kernel/DevelDumperTestTrait.php \Drupal\Tests\devel\Kernel\DevelDumperTestTrait::assertContainsDump()
Asserts that a haystack contains the dump output.
Use \Drupal\devel\DevelDumperManager::dump().
Parameters
$haystack: 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.
1 call to DevelDumperTestTrait::assertContainsDump()
- 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 83
Class
- DevelDumperTestTrait
- Provides a class for checking dumper output.
Namespace
Drupal\Tests\devel\KernelCode
public function assertContainsDump($haystack, $data, $name = NULL, $message = '') {
$output = $this->getDumperDump($data, $name);
$this->assertContains($output, (string) $haystack, $message);
}