Skip to content

su-narthur/wp-accountability

Repository files navigation

wp-accountability

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 link before going on.

Set up PHPUnit with WordPress
  1. In terminal, cd into wp-accountability/tests/
  2. wget https://phar.phpunit.de/phpunit.phar
  3. chmod +x phpunit.phar
  4. mkdir wordpress-dev
  5. cd wordpress-dev
  6. svn co http://develop.svn.wordpress.org/trunk/
  7. cd trunk
  8. cp ../../wp-tests-config.php .
  9. svn up
  10. ../../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.

Set up PHPUnit testing in PhpStorm
  1. Open the wp-accountability folder in PhpStorm
  2. Open PhpStorm preferences and select Languages > PHP
  3. Select an appropriate interpreter.
  4. Go to Languages > PHP > PHPUnit
  5. Set PHPUnit library to Path to phpunit.phar
  6. Navigate to and select wp-accountability/tests/phpunit.phar such that the full path is shown in the text box
  7. Apply changes and close settings
  8. 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages