Skip to content

Commit db14937

Browse files
committed
Initial commit
0 parents  commit db14937

12 files changed

+271
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
indent_style = space
9+
indent_size = 4
10+
11+
[*.yml*]
12+
indent_style = space
13+
indent_size = 2

.gitattributes

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
spec/ export-ignore
2+
.editorconfig export-ignore
3+
.gitattributes export-ignore
4+
.gitignore export-ignore
5+
.scrutinizer.yml export-ignore
6+
.travis.yml export-ignore
7+
CONTRIBUTING.md export-ignore
8+
phpspec.yml.ci export-ignore
9+
phpspec.yml.dist export-ignore

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build/
2+
vendor/
3+
composer.lock
4+
phpspec.yml

.scrutinizer.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
filter:
2+
paths: [src/*]
3+
checks:
4+
php:
5+
code_rating: true
6+
duplication: true
7+
tools:
8+
external_code_coverage: true
9+
php_code_sniffer:
10+
config:
11+
standard: "PSR2"

.travis.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
language: php
2+
3+
php:
4+
- 5.4
5+
- 5.5
6+
- 5.6
7+
- 7.0
8+
- hhvm
9+
10+
matrix:
11+
allow_failures:
12+
- php: 7.0
13+
- php: hhvm
14+
include:
15+
- php: 5.4
16+
env:
17+
- COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
18+
- COVERAGE=true
19+
- PHPSPEC_FLAGS="-c phpspec.yml.ci"
20+
21+
install:
22+
- travis_retry composer self-update
23+
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction
24+
25+
script: vendor/bin/phpspec run ${PHPSPEC_FLAGS}
26+
27+
after_script:
28+
- if [[ "$COVERAGE" = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
29+
- if [[ "$COVERAGE" = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Change Log
2+
3+
4+
## Unreleased

CONTRIBUTING.md

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Contributing
2+
3+
If you're here, you would like to contribute to this repository and you're really welcome!
4+
5+
6+
## Bug reports
7+
8+
If you find a bug or a documentation issue, please report it or even better: fix it :). If you report it,
9+
please be as precise as possible. Here is a little list of required information:
10+
11+
- Precise description of the bug
12+
- Details of your environment (for example: OS, PHP version, installed extensions)
13+
- Backtrace which might help identifing the bug
14+
15+
16+
## Security issues
17+
18+
If you discover any security related issues, please contact us at [[email protected]](mailto:[email protected]) instead of submitting an issue on Github. This allows us to fix the issue and release a security hotfix without publicly disclosing the vulnerability.
19+
20+
21+
## Feature requests
22+
23+
If you think a feature is missing, please report it or even better: implement it :). If you report it, describe the more
24+
precisely what you would like to see implemented and we will discuss what is the best approach for it. If you can do
25+
some research before submitting it and link the resources to your description, you're awesome! It will allow us to more
26+
easily understood/implement it.
27+
28+
29+
## Sending a Pull Request
30+
31+
If you're here, you are going to fix a bug or implement a feature and you're the best! To do it, first fork the repository, clone it and create a new branch with the following commands:
32+
33+
``` bash
34+
$ git clone [email protected]:your-name/repo-name.git
35+
$ git checkout -b feature-or-bug-fix-description
36+
```
37+
38+
Then install the dependencies through [Composer](https://getcomposer.org/):
39+
40+
``` bash
41+
$ composer install
42+
```
43+
44+
Write code and tests. When you are ready, find the testing command in the [README](README.md) and execute it. (This is usually [PHPUnit](http://phpunit.de/) or [PHPSpec](http://phpspec.net/))
45+
46+
When you are ready with the code, tested it and documented it, you can commit and push it with the following commands:
47+
48+
``` bash
49+
$ git commit -m "Feature or bug fix description"
50+
$ git push origin feature-or-bug-fix-description
51+
```
52+
53+
**Note:** Please write your commit messages in the imperative and follow the [guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) for clear and concise messages.
54+
55+
Then [create a pull request](https://help.github.com/articles/creating-a-pull-request/) on GitHub.
56+
57+
Please make sure that each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting with the following commands (here, we assume you would like to squash 3 commits in a single one):
58+
59+
``` bash
60+
$ git rebase -i HEAD~3
61+
```
62+
63+
If your branch conflicts with the master branch, you will need to rebase and repush it with the following commands:
64+
65+
``` bash
66+
$ git remote add upstream [email protected]:php-http/repo-name.git
67+
$ git pull --rebase upstream master
68+
$ git push -f origin feature-or-bug-fix-description
69+
```
70+
71+
72+
## Coding standard
73+
74+
This repository follows the [PSR-2 standard](http://www.php-fig.org/psr/psr-2/) and so, if you want to contribute,
75+
you must follow these rules.
76+
77+
78+
## Semver
79+
80+
We are trying to follow [semver](http://semver.org/). When you are making BC breaking changes, please let us know why you think it is important. In this case, your patch can only be included in the next major version.

LICENSE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2015 PHP HTTP Team <[email protected]>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Mock Adapter
2+
3+
[![Latest Version](https://img.shields.io/github/release/php-http/mock-adapter.svg?style=flat-square)](https://github.com/php-http/mock-adapter/releases)
4+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
5+
[![Build Status](https://img.shields.io/travis/php-http/mock-adapter.svg?style=flat-square)](https://travis-ci.org/php-http/mock-adapter)
6+
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/mock-adapter.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/mock-adapter)
7+
[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/mock-adapter.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/mock-adapter)
8+
[![Total Downloads](https://img.shields.io/packagist/dt/php-http/mock-adapter.svg?style=flat-square)](https://packagist.org/packages/php-http/mock-adapter)
9+
10+
**Mock HTTP Adapter for testing.**
11+
12+
13+
## Install
14+
15+
Via Composer
16+
17+
``` bash
18+
$ composer require php-http/mock-adapter
19+
```
20+
21+
22+
## Usage
23+
24+
Use this adapter in a testing framework.
25+
26+
27+
## Testing
28+
29+
``` bash
30+
$ phpspec run
31+
```
32+
33+
34+
## Contributing
35+
36+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
37+
38+
39+
## Security
40+
41+
If you discover any security related issues, please contact us at [[email protected]](mailto:[email protected]).
42+
43+
44+
## Credits
45+
46+
Thanks to [David de Boer](https://github.com/ddeboer) for implementing this adapter.
47+
48+
49+
## License
50+
51+
The MIT License (MIT). Please see [License File](LICENSE) for more information.

composer.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "php-http/mock-adapter",
3+
"description": "Mock HTTP Adapter for testing",
4+
"license": "MIT",
5+
"keywords": ["boilerplate", "http", "adapter", "psr7", "mock"],
6+
"homepage": "http://php-http.org",
7+
"authors": [
8+
{
9+
"name": "David de Boer",
10+
"email": "[email protected]"
11+
}
12+
],
13+
"require": {
14+
"php": ">=5.4",
15+
"php-http/adapter": "^0.1"
16+
},
17+
"require-dev": {
18+
"phpspec/phpspec": "^2.2",
19+
"henrikbjorn/phpspec-code-coverage" : "^1.0"
20+
},
21+
"provide": {
22+
"php-http/adapter-implementation": "0.1"
23+
},
24+
"autoload": {
25+
"psr-4": {
26+
"Http\\Adapter\\": "src/"
27+
}
28+
},
29+
"extra": {
30+
"branch-alias": {
31+
"dev-master": "0.1-dev"
32+
}
33+
},
34+
"prefer-stable": true,
35+
"minimum-stability": "dev"
36+
}

phpspec.yml.ci

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
suites:
2+
mock_adapter_suite:
3+
namespace: Http\Adapter
4+
psr4_prefix: Http\Adapter
5+
formatter.name: pretty
6+
extensions:
7+
- PhpSpec\Extension\CodeCoverageExtension
8+
code_coverage:
9+
format: clover
10+
output: build/coverage.xml

phpspec.yml.dist

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
suites:
2+
mock_adapter_suite:
3+
namespace: Http\Adapter
4+
psr4_prefix: Http\Adapter
5+
formatter.name: pretty

0 commit comments

Comments
 (0)