From 9ad874d69e3942a4b81df6f0c989ed991b7c1b25 Mon Sep 17 00:00:00 2001 From: Robert Hafner Date: Sat, 19 Apr 2014 22:01:22 -0700 Subject: [PATCH 1/3] Use Composer provided phpunit for tests This makes versioning pinning easier --- tests/bootstrap.php | 2 +- tests/runTests.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 3548183..c656c67 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -35,6 +35,6 @@ if (!file_exists($filename)) { $filename = __DIR__ .'/../autoload.php'; require_once $filename; } else { - $loader = require_once $filename; + $loader = require $filename; $loader->add('Fetch\\Test', __DIR__); } diff --git a/tests/runTests.sh b/tests/runTests.sh index d4dc032..c4a37bc 100755 --- a/tests/runTests.sh +++ b/tests/runTests.sh @@ -7,7 +7,7 @@ if [ ! -n "$TRAVIS" ]; then fi echo 'Running unit tests.' -phpunit --verbose --coverage-clover build/logs/clover.xml +./vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml echo '' echo '' From 9d26773f7fbf863e5386ecb1dae7c7b905fe05c7 Mon Sep 17 00:00:00 2001 From: Robert Hafner Date: Sat, 19 Apr 2014 23:42:19 -0700 Subject: [PATCH 2/3] use bin/php-cs-fixer instead of bundle version --- tests/runTests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/runTests.sh b/tests/runTests.sh index c4a37bc..0547fd7 100755 --- a/tests/runTests.sh +++ b/tests/runTests.sh @@ -14,4 +14,4 @@ echo '' echo '' echo 'Testing for Coding Styling Compliance.' echo 'All code should follow PSR standards.' -./vendor/fabpot/php-cs-fixer/php-cs-fixer fix ./ --level="all" -vv --dry-run \ No newline at end of file +./vendor/bin/php-cs-fixer fix ./ --level="all" -vv --dry-run \ No newline at end of file From 259545731c364a970003f8c6a1a0dc8038433c87 Mon Sep 17 00:00:00 2001 From: Robert Hafner Date: Sat, 19 Apr 2014 23:42:32 -0700 Subject: [PATCH 3/3] Added contributing file --- CONTRIBUTING.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..8fe815a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,54 @@ +# Contributions Welcome! + +Pull Requests and Community Contributions are the bread and butter of open source software. Every contribution- from bug +reports to feature requests, typos to full new features- are greatly appreciated. + + +## Important Guidelines + +* One Item Per Pull Request or Issue. This makes it much easier to review code and merge it back in, and prevents issues + with one request from blocking another. + +* Code Coverage is extremely important, and pull requests are much more likely to be accepted if testing is also improved. + New code should be properly tested, and all tests must pass. + +* Read the LICENSE document and make sure you understand it, because your code is going to be released under it. + +* Be prepared to make revisions. Don't be discouraged if you're asked to make changes, as that is just another step + towards refining the code and getting it merged back in. + +* Remember to add the relevant documentation, particular the docblock comments. + + +## Code Styling + +This project follows the PSR standards set forth by the [PHP Framework Interop Group](http://www.php-fig.org/). + +* [PSR-0: Class and file naming conventions](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) +* [PSR-1: Basic coding standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) +* [PSR-2: Coding style guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) + +All code most follow these standards to be accepted. The easiest way to accomplish this is to run php-cs-fixer once the +new changes are finished. The php-cs-fixer package is installed as a development dependency of this project. + + composer install --dev + vendor/bin/php-cs-fixer fix ./ --level="all" -vv + + +## Running the test suite + +First install dependencies using Composer. It's important to include the dev packages: + + composer install --dev + +The "runTests.sh" script runs the full test suite- phpunit, php-cs-fixer, as well as any environmental setup: + + tests/runTests.sh + +To call phpunit directly: + + vendor/bin/phpunit + +To call php-cs-fixer directly: + + vendor/bin/php-cs-fixer fix ./ --level="all" -vv --dry-run