Skip to content

Instantly share code, notes, and snippets.

@jtallant
Created July 20, 2012 21:22
Show Gist options
  • Select an option

  • Save jtallant/3153318 to your computer and use it in GitHub Desktop.

Select an option

Save jtallant/3153318 to your computer and use it in GitHub Desktop.
TDD with PHP using PHPUnit

Instructions for Mac only.

  1. Install the latest version of PHP. I used a one liner from http://php-osx.liip.ch/. The package comes with many useful extensions (like PHPUnit) curl -s http://php-osx.liip.ch/install.sh | bash -s 5.4

  2. Add that version to your path in your bash profile export PATH="/usr/local/php5/bin:$PATH"

  3. Confirm you are using the latest version which php or php -v will work

  4. Confirm you have access to phpunit by simply running phpunit in terminal.

  5. Refer to the PHPUnit documentation to start testing.

You may also want to check out composer, a php package manager.

Useful links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment