I’ve just finished writing a WordPress plugin implementing shortcode tag based autocompletion based on values retrieved from a database given an id set on a cookie. The plugin has...
I’m working on some tests for WordPress, and I discovered that WordPress’ PHPUnit automatically captures and doesn’t send emails (using MockPHPMailer) when I try to use wp_mail. I’ve looked,...
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for WordPress Development Stack Exchange. Closed 7...
I’m using WP_UnitTestCase but in my code I have this condition. is_front_page which I’m not sure how to simulate that in PHPUnit This is the piece of code that...
I am writing a few unit tests for a plugin that I have developed. However I seem to be hung up on testing one (seemingly) simple piece of code....
Using answers on this site and from other resources, I have started writing my next plugin using PHPUnit tests and the WordPress test environment. Distilling down what I have...
I’m currently doing some modifications on the WordPress plugin that I created in order to make it testable. The problem is I don’t know which methods am I suppose...
I’ve started to incorporate unit testing in my build. I have a class that creates a database table and a database version option. I have no idea how to...
I have some logic in my code that’s based on whether or not the user is logged in. How do I test it from my WP_UnitTestCase? 1 1 Call...
I’m using PHPUnit to Unit Test my WP plugin on top of the WP testing suite. Everything works fine except that when I try to create a table via...