Repository navigation
Conversation
268d816 to
82b6ddd
Compare
ef8ab8a to
40f7e65
Compare
mukeshpanchal27
left a comment
There was a problem hiding this comment.
Thanks @ramonjd, Can you add ticket number in unit tests?
| * @doesNotPerformAssertions | ||
| */ | ||
| public function test_context_param() { | ||
| // Controller does not use get_context_param(). |
There was a problem hiding this comment.
The controller does have context set, so this should get tests.
There was a problem hiding this comment.
Thanks for that.
I was looking at how other tests implement test_context_param() (example), and they're testing the data in $data['endpoints'] after an OPTIONS call.
This controller doesn't have any other endpoint, e.g., WP_REST_Server::CREATABLE and so I'm not sure how to test it. $data['endpoints'] doesn't have any testable data. Any tips?
I'll add another get_items test to check that the correct fields are returned however.
There was a problem hiding this comment.
I've added a test test_get_item_embed_context to check the difference when sending context as an arg in the GET request
peterwilsoncc
left a comment
There was a problem hiding this comment.
A couple of nit picks, really.
92207a8 to
de82ac9
Compare
|
Thank @TimothyBJacobs @spacedmonkey and @peterwilsoncc for helping me make this patch better. I think I've addressed all of the feedback, (except for the context test) at least I think so. Please let me know where it can be improved. |
d97362a to
41a765e
Compare
Spacing between comments
- Introducing pagination - Updating tests
reformatting functions in test
Was a mistake
…or both of them are set.
1ec3540 to
f9bb652
Compare
peterwilsoncc
left a comment
There was a problem hiding this comment.
A few nits but otherwise looks good.
spacedmonkey
left a comment
There was a problem hiding this comment.
This change looks good. The unit tests could do with @covers.
Formatting and test annotations to include @Covers
The following Global Revisions UI was added to Gutenberg in:
To support this, an endpoint (/wp/v2/global-styles/revisions) that returns revisions for the global styles custom post was added and updated in:
This PR adds the endpoint to Core and adds tests.
Trac ticket: https://core.trac.wordpress.org/ticket/58524
Testing
To test the endpoint in the site editor, fire up this branch and head over to the site editor.
In your browser's console, switch to the network tab and run the following :
npm run test:php -- --filter WP_REST_Global_Styles_Revisions_Controller_TestThis Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.