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
link
before going on.
- In terminal,
cd
intowp-accountability/tests/
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
mkdir wordpress-dev
cd wordpress-dev
svn co http://develop.svn.wordpress.org/trunk/
cd trunk
cp ../../wp-tests-config.php .
svn up
../../phpunit.phar
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 phpunit.phar
again.
- Open the
wp-accountability
folder in PhpStorm - Open PhpStorm preferences and select
Languages > PHP
- Select an appropriate interpreter.
- Go to
Languages > PHP > PHPUnit
- Set
PHPUnit library
toPath to phpunit.phar
- Navigate to and select
wp-accountability/tests/phpunit.phar
such that the full path is shown in the text box - Apply changes and close settings
- Right-click
tests/phpunit.xml
and 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.