Setting Up Your Development Environment with Docker
Note that these instructions will only work within the HabitFree
Docker environment and
after you've started the Docker environment containers using
./restart-env.sh. Follow the instructions at this
before going on.
Set up PHPUnit with WordPress
- In terminal,
chmod +x phpunit.phar
svn co http://develop.svn.wordpress.org/trunk/
cp ../../wp-tests-config.php .
If your installation of phpunit.phar is correct, PHPUnit should attempt to run the WordPress development tests. Otherwise, you should see a lot of html and error messages (commonly mysql connect error messages).
If you get this error:
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
Do this in Debian-based linux:
sudo apt-get install php5-mysql sudo service apache2 restart
And then try running
Set up PHPUnit testing in PhpStorm
- Open the
wp-accountabilityfolder in PhpStorm
- Open PhpStorm preferences and select
Languages > PHP
- Select an appropriate interpreter.
- Go to
Languages > PHP > PHPUnit
Path to phpunit.phar
- Navigate to and select
wp-accountability/tests/phpunit.pharsuch that the full path is shown in the text box
- Apply changes and close settings
tests/phpunit.xmland select "Run phpunit.xml". If all is well, the HabitFree plugin tests should run within PhpStorm.
Want to install the old, terrible, deprecated Bitnami way? Instructions here.