-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
test for API\ResponseTrait::format() with format is not json or xml #2793
test for API\ResponseTrait::format() with format is not json or xml #2793
Conversation
Using |
the application/json is based on detection of data, if the data is a "xml like", it will marked as application/xml. See that I changed format to "txt" in controller __construct that it means formatting will find best match of negotiation with check supported format |
this test the following lines https://github.com/codeigniter4/CodeIgniter4/blob/develop/system/API/ResponseTrait.php#L376-L379 |
I understand the test, my concern is that the function call in question:
... ends up calling
And in our test scenario
... so instead of checking for 'application/json; charset=UTF-8' should we check against something like |
a1b9fdf
to
bd2282c
Compare
Ok, I updated with check against : |
merge-able? |
Sorry! My email is a total train wreck. Thanks for the mention, they help! |
By this,
CodeIgniter\API\ResponseTrait
will have 100% test coverage.Checklist: