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.
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
Creating a WordPress install
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 --firstname.lastname@example.org
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
I’ve set up a version-controlled repository for the code retreat.
This time around I have branches with the boilerplate/scaffolding code for several testing frameworks including:
* DocTest for Python
* PHPUnit & SimpleTest for PHP
Had fun writing some code for custom processing of a Gravity form submission. I like how it turned out, mostly. I felt like I had an even better version, but the language couldn’t support it. Check it out.
Just a new face I got. Jus’ sayin’
Got my new glasses from http://goggles4u.com. The lenses are so clean that the world looks new and shiny! I need a haircut/makeover. :)
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 :)
doctest – Testing through documentation
This page has a somewhat in-depth set of examples for writing unit tests in Python with doctest.
http://pymotw.com/2/doctest/#working-around-whitespace specifically shows how to get around some whitespace formatting gotchas.