-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
How can I use WordPress functions in tests? #71
Comments
Deleting tests because of lucatume/wp-browser#71
I'm not sure if that option is available in wp browser now or not. I created a custom Codeception module a while back to load WordPress when the browser tests were being run: https://github.com/WordPoints/dev-lib/blob/develop/wpcept/includes/Modules/WordPointsLoader.php |
As JDGrimes rightly states that option was not explicitly supported, yet offered, from the Let me know if that helps; I'm releasing the new support in the next days. |
Thank you both. One issue: If two test suites both use This works$ codecept run suiteA
$ codecept run suiteB This results in errors$ codecept run SuiteA passes. However, suitB's My affected plugin: https://github.com/TypistTech/sunny |
Thanks for reporting this; I'm working to improve WPLoader compatibility and use in this context in these days and this is a good thing to know. |
Following this blog post http://www.theaveragedev.com/testing-the-rest-calculator/ , I added a
permission check
:I am using this in a ajax script on the admin area. It works fine when I add a
X-WP-Nonce
header (wp_create_nonce('wp_rest')
).However, I find no way to inject this
nonce
in the tests:$I->sendGET( '/calc/add/4/5' );
returns 403 errorsQuestion: How can I use WordPress functions (e.g:
wp_create_nonce('wp_rest')
) in the tests?Thanks!
The text was updated successfully, but these errors were encountered: