Theme unit test data Foreign fonts come in garbled on my machine
Having just tried out the Theme Unit Test Data from the WordPress.org Codex, I noticed that some of the body text doesn’t import … Read more
Having just tried out the Theme Unit Test Data from the WordPress.org Codex, I noticed that some of the body text doesn’t import … Read more
I am currently doing TDD with WordPress, in the PHPUnit I need to test if the meta box is actually registered on a … Read more
Sorry I feel like really stuck here. I have a plugin introducing a new Rest API controller (WP_REST_Controller) with basically a single endpoint … Read more
I’m writing up unit tests for my plugin and I need a logged in user to test, but I can’t find the admin … Read more
I have created a wordpress plugin which converts shortcodes to content based on the entry saved on the dataase: global $wpdb; $post_id = … Read more
I’ve been working very hard to get PHPUnit to play nice with WordPress (with the help of this, this, this, this, and this), … Read more
I have written a plugin, and am going through the process of setting up some unit tests for it. Inside of my unit … Read more
I’m trying to run PHPUnit to unittest a WordPress plugin, but the error below keeps showing up. Warning: mysqli_real_connect(): (HY000/2002): No such file … Read more
For writing unit-tests, why do most plugins use WP_UnitTestCase instead of popular libraries like WP_Mock? The reason I am asking this is because … Read more
I’m trying to mock get_adjacent_post for unit testing but I’m not sure how to mock global function in PHPUnit $badCode = $this->getMockBuilder(‘get_adjacent_post’) ->setMethods(array(‘somthing’)) … Read more