function UnitTestCaseTest::testVarDumpSameProcess
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/UnitTestCaseTest.php \Drupal\Tests\UnitTestCaseTest::testVarDumpSameProcess()
- 10 core/tests/Drupal/Tests/UnitTestCaseTest.php \Drupal\Tests\UnitTestCaseTest::testVarDumpSameProcess()
- 9 core/tests/Drupal/Tests/UnitTestCaseTest.php \Drupal\Tests\UnitTestCaseTest::testVarDumpSameProcess()
Tests the dump() function in a test run in the same process.
File
-
core/
tests/ Drupal/ Tests/ UnitTestCaseTest.php, line 22
Class
- UnitTestCaseTest
- Tests for the UnitTestCase class.
Namespace
Drupal\TestsCode
public function testVarDumpSameProcess() : void {
// Dump some variables.
$object = (object) [
'Aldebaran' => 'Betelgeuse',
];
dump($object);
dump('Alpheratz');
$dumpString = json_encode(DebugDump::getDumps());
$this->assertStringContainsString('Aldebaran', $dumpString);
$this->assertStringContainsString('Betelgeuse', $dumpString);
$this->assertStringContainsString('Alpheratz', $dumpString);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.