From 438f849fad0dc56b4eb499f730d1be1bdf980463 Mon Sep 17 00:00:00 2001 From: Justin Foell Date: Fri, 21 Sep 2018 10:28:46 -0500 Subject: [PATCH] Scaffolded unit tests --- composer.json | 4 +++- lib/autoload.php | 24 ++++++++++++++++++++++++ phpunit.xml | 22 ++++++++++++++++++++++ tests/WPStrava/SOMEnglishTest.php | 11 +++++++++++ tests/bootstrap.php | 6 ++++++ wp-strava.php | 29 ++++------------------------- 6 files changed, 70 insertions(+), 26 deletions(-) create mode 100644 lib/autoload.php create mode 100644 phpunit.xml create mode 100644 tests/WPStrava/SOMEnglishTest.php create mode 100644 tests/bootstrap.php diff --git a/composer.json b/composer.json index 30d829d..4b78448 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,8 @@ "php": ">=5.2.4" }, "require-dev": { - "wp-coding-standards/wpcs": "~0.14" + "wp-coding-standards/wpcs": "1.*", + "phpunit/phpunit": "^6", + "10up/wp_mock": "0.3.0" } } diff --git a/lib/autoload.php b/lib/autoload.php new file mode 100644 index 0000000..c1a9a6c --- /dev/null +++ b/lib/autoload.php @@ -0,0 +1,24 @@ + + + + + tests + + + + + + lib + + + diff --git a/tests/WPStrava/SOMEnglishTest.php b/tests/WPStrava/SOMEnglishTest.php new file mode 100644 index 0000000..8e4cae1 --- /dev/null +++ b/tests/WPStrava/SOMEnglishTest.php @@ -0,0 +1,11 @@ +assertInstanceOf( 'WPStrava_SOMEnglish', $som ); + } +} \ No newline at end of file diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..d84c73a --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,6 @@ +