Clone this repo, open PhpStorm, then run composer install
to install the dependencies.
git clone https://github.com/triplea-dev/triplea-woocommerce-plugin.git
open -a PhpStorm ./;
composer install;
For integration and acceptance tests, a local webserver must be running with localhost/triplea-cryptocurrency-payment-gateway-for-woocommerce/
pointing at the root of the repo. MySQL must also be running locally – with two databases set up with:
# export PATH=${PATH}:/usr/local/mysql/bin
# Make .env available to bash
export $(grep -v '^#' .env.testing | xargs)
mysql -u $mysql_username -p$mysql_password -e "CREATE USER '"$TEST_DB_USER"'@'%' IDENTIFIED WITH mysql_native_password BY '"$TEST_DB_PASSWORD"';";
mysql -u $mysql_username -p$mysql_password -e "CREATE DATABASE "$TEST_SITE_DB_NAME"; USE "$TEST_SITE_DB_NAME"; GRANT ALL PRIVILEGES ON "$TEST_SITE_DB_NAME".* TO '"$TEST_DB_USER"'@'%';";
mysql -u $mysql_username -p$mysql_password -e "CREATE DATABASE "$TEST_DB_NAME"; USE "$TEST_DB_NAME"; GRANT ALL PRIVILEGES ON "$TEST_DB_NAME".* TO '"$TEST_DB_USER"'@'%';";
See documentation on WordPress.org and GitHub.com.
Correct errors where possible and list the remaining with:
vendor/bin/phpcbf; vendor/bin/phpcs
Tests use the Codeception add-on WP-Browser and inlclude vanilla PHPUnit tests with WP_Mock.
Run tests with:
vendor/bin/codecept run unit;
vendor/bin/codecept run wpunit;
vendor/bin/codecept run integration;
vendor/bin/codecept run acceptance;
# Create dump after changing site.
export $(grep -v '^#' .env.testing | xargs);
mysqldump -u $TEST_SITE_DB_USER -p$TEST_SITE_DB_PASSWORD $TEST_SITE_DB_NAME > tests/_data/dump.sql;
See github.com/BrianHenryIE/WordPress-Plugin-Boilerplate for initial setup rationale.
The contributors to WordPress Plugin Boilerplate and more.