-
-
Notifications
You must be signed in to change notification settings - Fork 932
feat(debug): add a debug resource command #4401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(debug): add a debug resource command #4401
Conversation
samuelbigard
commented
Aug 31, 2021
Q | A |
---|---|
Branch? | main |
Type | Feature |
Tickets | |
License | MIT |
edeefa5
to
8e50f5a
Compare
8e50f5a
to
0c7cdb9
Compare
8f88ed1
to
af157d1
Compare
44e7e1d
to
8228db1
Compare
|
||
public function testDebugResource() | ||
{ | ||
$varDumper = $this->prophesize(CliDumper::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it's not necessary to mock this class (don't mock what you don't own). You may just instantiate a CliDumper
dumping to /dev/null
.
This should do the trick.
$varDumper = $this->prophesize(CliDumper::class); | |
$varDumper = new CliDumper('Windows' === PHP_OS_FAMILY ? 'NUL' : '/dev/null'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we want to test that dump is called isn't that alright?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should at least mock the interface instead of a concretion in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option could be to set php://memory
as output and to assert that something has been written in it.
8228db1
to
b7a8662
Compare
b7a8662
to
b63200c
Compare
Thanks @samuelbigard ! |