Problem/Motivation
- KernelTests run in isolation
- Therefore phpunit creates some template file to keep global state on the child processes
- By default the result of that template file is piped into a php process which makes it hard to debug
Proposed resolution
- Store the result of the template in a file to improve debugability. PHPunit does this for Windows already. Include the Windows class under the generic name so it's always used.
- Therefore file a PR against phpunit: https://github.com/sebastianbergmann/phpunit/pull/1942
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2611202-3.patch | 7.74 KB | dawehner |
Comments
Comment #2
dawehnerComment #3
dawehnerThe alternative solution is to hack bootstrap for that.
Comment #4
chx commentedComment #6
claudiu.cristeaThis is very useful but I wonder how this can be used?
Comment #7
chx commentedOpen template file, set breakpoint, be happy.
Comment #8
jibranWhat is the status of the PR(s)?
Comment #10
chx commentedComment #11
dawehnerIt would be nice to have some steps of reproducing. I don't remember how to do so.
@chx
Do you remember what kind of error you need?
Comment #12
chx commentedSee #7 for needs. There's no error.
Comment #17
joachim commentedIs this related / similar to #2795567: Use Symfony's VarDumper for easier test debugging with dump()?
Comment #20
司南 commentedComment #21
司南 commentedCurrently, KernelTests can not be run with xdebug, is it possible to deal solve this?
What is the correct way?
Comment #22
司南 commentedFor #7
Where is the template file? what is it used for?
Comment #27
smustgrave commentedHave found that it is possible now to use xdebug in tests.
Seems also more support requesty
Comment #28
fgmCould you point to an explanation about how to use xdebug for kernel tests. It still seems fairly involved /esoteric to me.
Comment #29
smustgrave commentedFor me I got it working with ddev and phpstorm.
Would have to dig up the article but it came pretty out of the box working.