From b778b7db6b00111e938b3d67ee19230f8fd3cd43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rk=20S=C3=A1gi-Kaz=C3=A1r?= Date: Tue, 23 Aug 2016 10:07:52 +0200 Subject: [PATCH] General package improvements --- .gitattributes | 28 +++++++++++---------- .github/CONTRIBUTING.md | 3 +++ .github/ISSUE_TEMPLATE.md | 27 ++++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 43 ++++++++++++++++++++++++++++++++ .gitignore | 11 ++++---- .styleci.yml | 5 +++- .travis.yml | 13 ++++++---- CONTRIBUTING | 1 - README.md | 11 +++++--- composer.json | 2 +- phpspec.yml.ci => phpspec.ci.yml | 0 11 files changed, 114 insertions(+), 30 deletions(-) create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 CONTRIBUTING rename phpspec.yml.ci => phpspec.ci.yml (100%) diff --git a/.gitattributes b/.gitattributes index 5dd7941..c47225a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,13 +1,15 @@ -spec/ export-ignore -tests/ export-ignore -.editorconfig export-ignore -.gitattributes export-ignore -.gitignore export-ignore -.php_cs export-ignore -.scrutinizer.yml export-ignore -.styleci.yml export-ignore -.travis.yml export-ignore -CONTRIBUTING export-ignore -phpspec.yml.ci export-ignore -phpspec.yml.dist export-ignore -phpunit.xml.dist export-ignore +.editorconfig export-ignore +.gitattributes export-ignore +/.github/ export-ignore +.gitignore export-ignore +/.php_cs export-ignore +/.scrutinizer.yml export-ignore +/.styleci.yml export-ignore +/.travis.yml export-ignore +/behat.yml.dist export-ignore +/features/ export-ignore +/phpspec.ci.yml export-ignore +/phpspec.yml.dist export-ignore +/phpunit.xml.dist export-ignore +/spec/ export-ignore +/tests/ export-ignore diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..fb288d9 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,3 @@ +# Contributing + +Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..d4ecf20 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,27 @@ +| Q | A +| ------------ | --- +| Bug? | no|yes +| New Feature? | no|yes +| Version | Specific version or SHA of a commit + + +#### Actual Behavior + +What is the actual behavior? + + +#### Expected Behavior + +What is the behavior you expect? + + +#### Steps to Reproduce + +What are the steps to reproduce this bug? Please add code examples, +screenshots or links to GitHub repositories that reproduce the problem. + + +#### Possible Solutions + +If you have already ideas how to solve the issue, add them here. +(remove this section if not needed) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..323987b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,43 @@ +| Q | A +| --------------- | --- +| Bug fix? | no|yes +| New feature? | no|yes +| BC breaks? | no|yes +| Deprecations? | no|yes +| Related tickets | fixes #X, partially #Y, mentioned in #Z +| Documentation | if this is a new feature, link to pull request in https://github.com/php-http/documentation that adds relevant documentation +| License | MIT + + +#### What's in this PR? + +Explain what the changes in this PR do. + + +#### Why? + +Which problem does the PR fix? (remove this section if you linked an issue above) + + +#### Example Usage + +``` php +// If you added new features, show examples of how to use them here +// (remove this section if not a new feature) + +$foo = new Foo(); + +// Now we can do +$foo->doSomething(); +``` + + +#### Checklist + +- [ ] Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix +- [ ] Documentation pull request created (if not simply a bugfix) + + +#### To Do + +- [ ] If the PR is not complete but you want to discuss the approach, list what remains to be done here diff --git a/.gitignore b/.gitignore index 7608c4b..16b4a20 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -build/ -vendor/ -composer.lock -phpspec.yml -phpunit.xml +/behat.yml +/build/ +/composer.lock +/phpspec.yml +/phpunit.xml +/vendor/ diff --git a/.styleci.yml b/.styleci.yml index cec81a8..5328b61 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -3,9 +3,12 @@ preset: symfony finder: exclude: - "spec" - - "tests" path: - "src" + - "tests" enabled: - short_array_syntax + +disabled: + - phpdoc_annotation_without_dot # This is still buggy: https://github.com/symfony/symfony/pull/19198 diff --git a/.travis.yml b/.travis.yml index 2bab78c..bf8dec8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,12 +4,13 @@ sudo: false cache: directories: - - $HOME/.composer/cache + - $HOME/.composer/cache/files php: - 5.5 - 5.6 - 7.0 + - 7.1 - hhvm env: @@ -27,14 +28,16 @@ matrix: env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci" before_install: - - travis_retry composer self-update + - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi install: - - travis_retry composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction + # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 + - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi + - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction script: - $TEST_COMMAND after_success: - - if [[ "$COVERAGE" = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi - - if [[ "$COVERAGE" = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi + - if [[ $COVERAGE = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi + - if [[ $COVERAGE = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi diff --git a/CONTRIBUTING b/CONTRIBUTING deleted file mode 100644 index 841914a..0000000 --- a/CONTRIBUTING +++ /dev/null @@ -1 +0,0 @@ -Please see http://docs.php-http.org/en/latest/development/contributing.html diff --git a/README.md b/README.md index d07fca9..c6d34de 100644 --- a/README.md +++ b/README.md @@ -15,18 +15,21 @@ Via Composer ``` bash -$ composer require php-http/mock-client +$ composer require --dev php-http/mock-client ``` ## Usage -Use this client in a testing framework. +This client does not actually send requests to any server. + +Instead it stores the request and returns a pre-set response or throws an exception. This client is useful for unit +testing code that depends on a HTTPlug client to send requests and receive responses. ## Documentation -Please see the [official documentation](http://docs.php-http.org). +Please see the [official documentation](http://docs.php-http.org/en/latest/clients/mock-client.html). ## Testing @@ -48,7 +51,7 @@ If you discover any security related issues, please contact us at [security@php- ## Credits -Thanks to [David de Boer](https://github.com/ddeboer) for implementing this client. +Thanks to [David de Boer](https://github.com/ddeboer) for implementing the mock client. ## License diff --git a/composer.json b/composer.json index d572b9e..19ee3b2 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "scripts": { "test": "vendor/bin/phpspec run", - "test-ci": "vendor/bin/phpspec run -c phpspec.yml.ci" + "test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml" }, "extra": { "branch-alias": { diff --git a/phpspec.yml.ci b/phpspec.ci.yml similarity index 100% rename from phpspec.yml.ci rename to phpspec.ci.yml