Setting up a WordPress install for “theme unit tests”

Documentation for Theme Unit Tests is at http://codex.wordpress.org/Theme_Unit_Test

Did it all through the Mac terminal…

Pre-requisites: Homebrew, homebrew’s mysql package ( brew install mysql ), and homebrew’s php55 package. Ask if you have trouble installing them.

Installing wp-cli

Documentation for wp-cli is at http://wp-cli.org/

curl -kL https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar > wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
wp --info

Creating a WordPress install

mkdir wp-trt
cd wp-trt/
wp core download
wp core config --dbname=wp-trt --dbuser=root
wp db create
wp core install --url=http://localhost:6789 --title=WPTRT --admin_user=danny --admin_password=blastworth --admin_email=dan@bernardic.ca
nohup php -S localhost:6789 &
* I was getting an error recently with a fresh install of mysql from homebrew, saying a database connection can not be established, during the `wp core install` step. After creating the symlinks as shown here, it worked.

Installing theme unit tests

curl -O https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml
wp plugin install wordpress-importer --activate
wp import ./theme-unit-test-data.xml --authors=create
rm theme-unit-test-data.xml

2014 Prairie Dev Con’s Free Code Retreat – Registration is open!

I’m very excited to let you all know that registration is open for the code retreat organized by Prairie Dev Con. Go register here.

I always get excited for code retreats. If you have time and want to know more before you sign up, you can read my previous posts about them here and here, or get in touch and I’ll try to convince ya :)

Follow

Get every new post delivered to your Inbox.

Join 348 other followers