Promote a non-200 response from the cron spawn test to an error#66
Conversation
| Scenario: Testing WP-Cron | ||
| When I try `wp cron test` | ||
| Then STDERR should not contain: | ||
| """ | ||
| Error: | ||
| """ | ||
|
|
There was a problem hiding this comment.
Instead of deleting this test, I think it should stay for a valid setup check, and we need to add a second test after deleting the wp-cron.php to verify that it does indeed throw an error.
There was a problem hiding this comment.
As I mentioned in the issue description, this scenario performs a request to example.com over the internet (which returns a 404 because example.com doesn't use WordPress).
@schlessera Does WP-CLI contain any existing tests which perform an HTTP request to an actual local WordPress site?
There was a problem hiding this comment.
You could probably point to the proper WordPress instance using something like this as setup and populating the options accordingly:
Given a WP install
And I launch in the background `wp server --host=localhost --port=8080`
There was a problem hiding this comment.
Ah yeah nice, I'll look into it.
…r than a warning.
…quest to `example.com`
236e273 to
5191037
Compare
|
Nice work on that test |
Fixes #65
Note that the current feature test for testing the cron spawner sends an HTTP request to
example.com(which is the default domain configured for the tests), so here I'm removing it because it's useless and it's not possible to affect its response. Suggestions welcome for improving this.