diff --git a/.gitignore b/.gitignore index 2282b20..0c61920 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.bak /.idea +/coverage_clover.xml /phive.xml /tools composer.lock diff --git a/README.md b/README.md index 3576e8f..35fecc8 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,18 @@ $csv->output('movies.csv', $data_array, $header, ','); For more complex examples, see the ``tests`` and `examples` directories. +## Test coverage + +All tests are located in the `tests` directory. To execute tests, run the following commands: + +````bash +composer install +composer run test +```` + +When pushing code to GitHub, tests will be executed using Travis CI. The relevant configuration is in the +file `.travis.yml`. + ## Credits * ParseCsv is based on the concept of [Ming Hong Ng][ming]'s [CsvFileParser][] diff --git a/composer.json b/composer.json index 8a34e64..cbbaca0 100644 --- a/composer.json +++ b/composer.json @@ -45,6 +45,11 @@ "dev-master": "1.0.x-dev" } }, + "scripts": { + "test": [ + "vendor/bin/phpunit -c tests tests --disallow-test-output --coverage-clover coverage_clover.xml --whitelist src" + ] + }, "support": { "issues": "https://github.com/parsecsv/parsecsv-for-php/issues", "source": "https://github.com/parsecsv/parsecsv-for-php"