From e98b8f61ba79a1c493731aef57d22036725fd2bc Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Tue, 13 Oct 2015 14:08:27 -0400 Subject: [PATCH] Group tests by test suite. - Grouping the tests by test suite to avoid warning failures when there are no test in a suite. Requires the use of the phpunit `--group` flag. --- .travis.yml | 4 ++-- README.md | 4 ++-- test.php | 9 +++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 978e886..ac06ed0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,9 @@ sudo: false # all of the reference implementations? script: - git clone https://github.com/json-ld/json-ld.org.git _json-ld.org - - phpunit test.php -d ./_json-ld.org/test-suite + - phpunit --group json-ld.org test.php -d ./_json-ld.org/test-suite - git clone https://github.com/json-ld/normalization.git _normalization - - phpunit test.php -d ./_normalization/tests + - phpunit --group normalization test.php -d ./_normalization/tests notifications: email: on_success: change diff --git a/README.md b/README.md index f21b23a..589b93f 100644 --- a/README.md +++ b/README.md @@ -179,8 +179,8 @@ the `json-ld.org` and `normalization` repositories hosted on GitHub: Then run the PHPUnit test.php application and point it at the directories containing the tests: - phpunit test.php -d {PATH_TO_JSON_LD_ORG/test-suite} - phpunit test.php -d {PATH_TO_NORMALIZATION/tests} + phpunit --group json-ld.org test.php -d {PATH_TO_JSON_LD_ORG/test-suite} + phpunit --group normalization test.php -d {PATH_TO_NORMALIZATION/tests} [Digital Bazaar]: http://digitalbazaar.com/ [JSON-LD]: http://json-ld.org/ diff --git a/test.php b/test.php index d45ab51..dfac4c9 100644 --- a/test.php +++ b/test.php @@ -28,6 +28,7 @@ class JsonLdTestCase extends PHPUnit_Framework_TestCase { * @param JsonLdTest $test the test to run. * * @group expand + * @group json-ld.org * @dataProvider expandProvider */ public function testExpand($test) { @@ -43,6 +44,7 @@ class JsonLdTestCase extends PHPUnit_Framework_TestCase { * @param JsonLdTest $test the test to run. * * @group compact + * @group json-ld.org * @dataProvider compactProvider */ public function testCompact($test) { @@ -59,6 +61,7 @@ class JsonLdTestCase extends PHPUnit_Framework_TestCase { * @param JsonLdTest $test the test to run. * * @group flatten + * @group json-ld.org * @dataProvider flattenProvider */ public function testFlatten($test) { @@ -75,6 +78,7 @@ class JsonLdTestCase extends PHPUnit_Framework_TestCase { * @param JsonLdTest $test the test to run. * * @group toRdf + * @group json-ld.org * @dataProvider toRdfProvider */ public function testToRdf($test) { @@ -90,6 +94,7 @@ class JsonLdTestCase extends PHPUnit_Framework_TestCase { * @param JsonLdTest $test the test to run. * * @group fromRdf + * @group json-ld.org * @dataProvider fromRdfProvider */ public function testFromRdf($test) { @@ -105,6 +110,7 @@ class JsonLdTestCase extends PHPUnit_Framework_TestCase { * @param JsonLdTest $test the test to run. * * @group frame + * @group json-ld.org * @dataProvider frameProvider */ public function testFrame($test) { @@ -121,6 +127,7 @@ class JsonLdTestCase extends PHPUnit_Framework_TestCase { * @param JsonLdTest $test the test to run. * * @group normalize + * @group json-ld.org * @dataProvider normalizeProvider */ public function testNormalize($test) { @@ -136,6 +143,7 @@ class JsonLdTestCase extends PHPUnit_Framework_TestCase { * @param JsonLdTest $test the test to run. * * @group normalize + * @group normalization * @dataProvider urgna2012Provider */ public function testUrgna2012($test) { @@ -154,6 +162,7 @@ class JsonLdTestCase extends PHPUnit_Framework_TestCase { * @param JsonLdTest $test the test to run. * * @group normalize + * @group normalization * @dataProvider urdna2015Provider */ public function testUrdna2015($test) {