From 7dc78f689f776737db63445d63c0bfa58b895d79 Mon Sep 17 00:00:00 2001 From: Azizur Rahman Date: Thu, 21 Apr 2016 19:59:38 +0100 Subject: [PATCH] Setup dockunit for testing --- Dockunit.json | 35 +++++++++++++++++++++++++++++++++++ README.md | 18 +++++++++++++++++- phpunit.xml | 13 +++++++++++++ tests/bootstrap.php | 9 +++++++++ 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 Dockunit.json create mode 100644 phpunit.xml create mode 100644 tests/bootstrap.php diff --git a/Dockunit.json b/Dockunit.json new file mode 100644 index 0000000..c59688d --- /dev/null +++ b/Dockunit.json @@ -0,0 +1,35 @@ +{ + "containers": [{ + "prettyName": "PHP-FPM 7.0", + "image": "dockunit/prebuilt-images:php-mysql-phpunit-wordpress-7.0-rc-1-fpm", + "beforeScripts": [ + "service mysql start", + "wp core download --path=/temp/wp --allow-root", + "wp core config --path=/temp/wp --dbname=test --dbuser=root --allow-root", + "wp core install --url=http://localhost --title=Test --admin_user=admin --admin_password=12345 --admin_email=test@test.com --path=/temp/wp --allow-root", + "mkdir /temp/wp/wp-content/plugins/arabic-ligature", + "cp -r . /temp/wp/wp-content/plugins/arabic-ligature" + ], + "testCommand": "wp plugin activate arabic-ligature --allow-root --path=/temp/wp" + }, { + "prettyName": "PHP-FPM 5.6", + "image": "dockunit/prebuilt-images:php-mysql-phpunit-wordpress-5.6-fpm", + "beforeScripts": [ + "service mysql start", + "wp core download --path=/temp/wp --allow-root", + "wp core config --path=/temp/wp --dbname=test --dbuser=root --allow-root", + "wp core install --url=http://localhost --title=Test --admin_user=admin --admin_password=12345 --admin_email=test@test.com --path=/temp/wp --allow-root", + "mkdir /temp/wp/wp-content/plugins/arabic-ligature", + "cp -r . /temp/wp/wp-content/plugins/arabic-ligature" + ], + "testCommand": "wp plugin activate arabic-ligature --allow-root --path=/temp/wp" + }, { + "prettyName": "PHP-FPM 5.2", + "image": "dockunit/prebuilt-images:php-mysql-phpunit-wordpress-5.2-fpm", + "beforeScripts": [ + "service mysql start", + "wp-install latest" + ], + "testCommand": "wp-activate-plugin arabic-ligature.php" + }] +} diff --git a/README.md b/README.md index 5897475..be76427 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,20 @@ Supported Short Codes: | [salaam]
[sallam] | السلام عليكم | السلام عليكم | As-salamu alaykum | Peace be upon you | | [wasalaam]
[wasallam]
[waalaykumu] | وعليكم السلام | وعليكم السلام | Wa ‘alaykum al-salaam | And unto you peace | | [allah] | ﷲ | ﷲ | Allāh | Allah (God) | -| [swt]
[jallajalaluh]
[jallajalalouhou] | ﷻ | سبحانه و تعالى | Jalla Jalāluhu | May He be Glorified and Exalted | \ No newline at end of file +| [swt]
[jallajalaluh]
[jallajalalouhou] | ﷻ | سبحانه و تعالى | Jalla Jalāluhu | May He be Glorified and Exalted | + + +# Development + +## Unit Testing + +install Dockunit: + +``` +npm install -g dockunit +``` + +Run tests +``` +dockunit --du-verbose +``` diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..46c86ce --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,13 @@ + + + + ./tests/ + + + diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..f502fd0 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,9 @@ +