dump() calls in tests are producing a PHPUnit\Framework\Exception

Created on 3 June 2024, 7 months ago
Updated 17 July 2024, 5 months ago

Problem/Motivation

dump() statements in kernel tests are now causing the test to fail with exception: PHPUnit\Framework\Exception, rather than the actual failure of the test.

I'm not sure why testVarDump() isn't showing this up!

Steps to reproduce

Open any kernel test file like:
root_folder_project/core/modules/views/tests/src/Kernel/TokenReplaceTest.php
Use dump($variable) anywhere in the file
Go to terminal run the kernel test
You 'll observe variable render , but test fails with PHPUnit\Framework\Exception error, but in actual there is no error in the file.

Expected behaviour

If we use dump() in the kernel test file, then use of dump file should not cause to fail the test case.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
PHPUnit 

Last updated about 14 hours ago

Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024