Theme Check gives: Required: This theme doesn’t seem to display tags?

You need to be using one of these functions to display a list of tags associated with the post: the_tags() get_the_tag_list() get_the_term_list() Otherwise the check will fail. If you’re building this theme for use with a project that doesn’t need tags, don’t bother adding support. If you’re intending on uploading it to WordPress.org for review, … Read more

Using wp_mail during an integration test

I was working on some tests for code that involved wp_mail() just the other day. I couldn’t find any docs on it either, but I took a look at the source of mock-mailer.php, and everything was rather simple. First, you should understand that WordPress always uses the $phpmailer global to hold an instance of the … Read more

Can I get at WordPress code from inside a Selenium test?

There are many ways to skin a cat and trying to use Selenium with WordPress CLI is new to me. Essentially, WordPress is ‘just’ a dynamic website using a SQL database with some themes and plugin files behind it. Selenium is designed as a frontend browser test tool so keep that in mind for a … Read more

PHPUnit testing WordPress Plugin

The reason the WordPress test bootstrap is loaded at the end is precisely because it loads WordPress: // Load WordPress require_once ABSPATH . ‘/wp-settings.php’; If you don’t hook your function to load your plugin to ‘muplugins_loaded’ before including the bootstrap, your plugin won’t be loaded with WordPress. In most cases that will mean that your … Read more

PHP unit testing WordPress?

There is nothing stopping you from writing your own unit testing for themes/plugins using PHPUnit or some other testing platform. As for WordPress, it has an official Unit Tests here: http://unit-tests.svn.wordpress.org/trunk/ https://github.com/kurtpayne/wordpress-unit-tests (github mirror) There are several build scripts that can automate unit testing found here, including WP-CLI that have built in unit testing, though … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)