Skip to content
Snippets Groups Projects
Verified Commit 321dc38a authored by Alex Pott's avatar Alex Pott Committed by Dave Long
Browse files

Issue #3432171 by mondrake: dump() no longer produces output in PHPUnit tests running under PHP 8.3

(cherry picked from commit 80139bdb)
parent 5a4f9ee2
No related branches found
No related tags found
6 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.,!7567Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7565Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7509Change label "Block description" to "Block type",!7344Issue #3292350 by O'Briat, KlemenDEV, hswong3i, smustgrave, quietone: Update...
Pipeline #129453 passed
Pipeline: drupal

#129463

    Pipeline: drupal

    #129460

      Pipeline: drupal

      #129458

        +1
        ...@@ -572,11 +572,11 @@ public function testDeprecationHeaders() { ...@@ -572,11 +572,11 @@ public function testDeprecationHeaders() {
        * Tests the dump() function provided by the var-dumper Symfony component. * Tests the dump() function provided by the var-dumper Symfony component.
        */ */
        public function testVarDump() { public function testVarDump() {
        // Append the stream capturer to the STDOUT stream, so that we can test the // Append the stream capturer to the STDERR stream, so that we can test the
        // dump() output and also prevent it from actually outputting in this // dump() output and also prevent it from actually outputting in this
        // particular test. // particular test.
        stream_filter_register("capture", StreamCapturer::class); stream_filter_register("capture", StreamCapturer::class);
        stream_filter_append(STDOUT, "capture"); stream_filter_append(STDERR, "capture");
        // Dump some variables to check that dump() in test code produces output // Dump some variables to check that dump() in test code produces output
        // on the command line that is running the test. // on the command line that is running the test.
        ......
        ...@@ -341,11 +341,11 @@ public function testProfileModules() { ...@@ -341,11 +341,11 @@ public function testProfileModules() {
        * Tests the dump() function provided by the var-dumper Symfony component. * Tests the dump() function provided by the var-dumper Symfony component.
        */ */
        public function testVarDump() { public function testVarDump() {
        // Append the stream capturer to the STDOUT stream, so that we can test the // Append the stream capturer to the STDERR stream, so that we can test the
        // dump() output and also prevent it from actually outputting in this // dump() output and also prevent it from actually outputting in this
        // particular test. // particular test.
        stream_filter_register("capture", StreamCapturer::class); stream_filter_register("capture", StreamCapturer::class);
        stream_filter_append(STDOUT, "capture"); stream_filter_append(STDERR, "capture");
        // Dump some variables. // Dump some variables.
        $this->enableModules(['system', 'user']); $this->enableModules(['system', 'user']);
        ......
        ...@@ -22,7 +22,7 @@ class TestVarDumper { ...@@ -22,7 +22,7 @@ class TestVarDumper {
        public static function cliHandler($var) { public static function cliHandler($var) {
        $cloner = new VarCloner(); $cloner = new VarCloner();
        $dumper = new CliDumper(); $dumper = new CliDumper();
        fwrite(STDOUT, "\n"); fwrite(STDERR, "\n");
        $dumper->setColors(TRUE); $dumper->setColors(TRUE);
        $dumper->dump( $dumper->dump(
        $cloner->cloneVar($var), $cloner->cloneVar($var),
        ...@@ -30,7 +30,7 @@ function ($line, $depth, $indent_pad) { ...@@ -30,7 +30,7 @@ function ($line, $depth, $indent_pad) {
        // A negative depth means "end of dump". // A negative depth means "end of dump".
        if ($depth >= 0) { if ($depth >= 0) {
        // Adds a two spaces indentation to the line. // Adds a two spaces indentation to the line.
        fwrite(STDOUT, str_repeat($indent_pad, $depth) . $line . "\n"); fwrite(STDERR, str_repeat($indent_pad, $depth) . $line . "\n");
        } }
        } }
        ); );
        ......
        ...@@ -17,11 +17,11 @@ class UnitTestCaseTest extends UnitTestCase { ...@@ -17,11 +17,11 @@ class UnitTestCaseTest extends UnitTestCase {
        * Tests the dump() function in a test run in the same process. * Tests the dump() function in a test run in the same process.
        */ */
        public function testVarDumpSameProcess() { public function testVarDumpSameProcess() {
        // Append the stream capturer to the STDOUT stream, so that we can test the // Append the stream capturer to the STDERR stream, so that we can test the
        // dump() output and also prevent it from actually outputting in this // dump() output and also prevent it from actually outputting in this
        // particular test. // particular test.
        stream_filter_register("capture", StreamCapturer::class); stream_filter_register("capture", StreamCapturer::class);
        stream_filter_append(STDOUT, "capture"); stream_filter_append(STDERR, "capture");
        // Dump some variables. // Dump some variables.
        $object = (object) [ $object = (object) [
        ...@@ -40,11 +40,11 @@ public function testVarDumpSameProcess() { ...@@ -40,11 +40,11 @@ public function testVarDumpSameProcess() {
        * @runInSeparateProcess * @runInSeparateProcess
        */ */
        public function testVarDumpSeparateProcess() { public function testVarDumpSeparateProcess() {
        // Append the stream capturer to the STDOUT stream, so that we can test the // Append the stream capturer to the STDERR stream, so that we can test the
        // dump() output and also prevent it from actually outputting in this // dump() output and also prevent it from actually outputting in this
        // particular test. // particular test.
        stream_filter_register("capture", StreamCapturer::class); stream_filter_register("capture", StreamCapturer::class);
        stream_filter_append(STDOUT, "capture"); stream_filter_append(STDERR, "capture");
        // Dump some variables. // Dump some variables.
        $object = (object) [ $object = (object) [
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment