Installing PHPUnit On Windows

I wanted to start contributing to the WordPress unit tests so I needed to install PHPUnit. Turned out it was harder than it might seem (I had a tough time getting it all working) so I thought I’d blog what finally ended up working for me to help save some people some time.

Assuming you already have PHP and MySQL installed, here’s the steps you need to take:

  1. Install PEAR, a dependency for PHPUnit:
    1. Visit http://pear.php.net/go-pear.phar in your browser and save the file into your PHP directory. This is the folder where you can find php.exe.
    2. Open an administrator command prompt. On Vista or Windows 7, hit your Windows key, type “cmd”, right-click the resulting “cmd.exe” search result, and select “Run as administrator”. Navigate to the folder where you have PHP installed, the same folder where you saved the file in the previous step.
    3. Type the following command to execute the file you just downloaded: php go-pear.phar
    4. After a moment, you should start being prompted for some things. The installer is pretty self-explanatory and I think you want a system installation rather than a local one.
    5. Open the folder where PHP is installed and double-click the PEAR_ENV.reg file that has been created. This allows you to run the pear command from any folder.
    6. Verify PEAR is working by running the command pear version
  2. Install PHPUnit:
    1. Turn on auto_discover in PEAR by typing the following command at the command line: pear config-set auto_discover 1
    2. Download and install PHPUnit by running the following command: pear install pear.phpunit.de/PHPUnit
    3. In order to be able to run the phpunit command from any folder, you need to add it to your Windows Path value. Right-click My Computer → Properties → Advanced system settings → Environmental Variables → select “Path” under “System Variables” → Edit → Add a semi-colon (;) and then the full path to your PHP folder onto the end of the value, for example like this: ;D:\Webserver\php
    4. Verify PHPUnit is working by running the command phpunit --version
  3. Set up the WordPress unit tests by following the rest of the steps on the WordPress Core Contributor Handbook now that you have PHPUnit installed.

Done!

jQuery Lightbox For Native Galleries Plugin Discontinued

With the release of Jetpack 1.5, Jetpack now supports the awesome carousel feature that you may have seen running on WordPress.com. It’s superior to my jQuery Lightbox For Native Galleries plugin in my opinion so I am opting to discontinue development on my plugin.

My plugin should continue to work for the indefinite future but I will no longer be maintaining it.

WordPress License Plates

I moved my “IM STIG” license plates over to my Dodge Viper so I had to get new plates for my Ford Mustang. What to get on my plates this time around seemed like an obvious choice! :)

WordPress License Plates

UPDATE: It looks like I’m the fifth sixth person to get WordPress license plates! Ryan Duff (Pennsylvania), Jonathan Dingman (California), Michael Torbert (North Carolina), AJ Morris (Michigan), and Jesse Friedman (Rhode Island) also have them. Awesome. :cool:

JW FLV Player Removed From My “Viper’s Video Quicktags” Plugin

JW FLV Player has been removed from the latest version of my Viper’s Video Quicktags plugin. The player is not compatible with the GPL license and as a result cannot be included in plugins that are hosted in the WordPress.org plugin repository. I shouldn’t have added the player to my plugin in the first place but it was the only decent player at the time oh so many years ago. Today I have rectified that mistake by removing it from my plugin’s download.

However do not fear — I have not actually removed the functionality, I just no longer bundle it with my plugin. If you wish to continue to use the player to embed .flv and .mp4 files after upgrading to version 6.4.0 of my plugin, you will need to download this ZIP file and extract it to your wp-content folder, resulting in /wp-content/jw-flv-player/player.swf. I’m hosting the ZIP file since my plugin uses an old version of the player that is no longer available for download from the official site.

This is a temporary band-aid fix. The eventual plan is to switch to the GPL-licensed Flowplayer but that won’t happen until I complete the latest recode of my plugin which introduces many much-needed features. Whether I’ll actually ever finish version 7.0 of my plugin is another matter though.

If you have any questions or need any help, please post over on the Viper’s Video Quicktags page.