2
2
3
3
[ ![ PHP from Packagist] ( https://img.shields.io/packagist/php-v/swisnl/php-http-fixture-client.svg )] ( https://packagist.org/packages/swisnl/php-http-fixture-client )
4
4
[ ![ Latest Version on Packagist] ( https://img.shields.io/packagist/v/swisnl/php-http-fixture-client.svg )] ( https://packagist.org/packages/swisnl/php-http-fixture-client )
5
- [ ![ Software License] ( https://img.shields.io/packagist/l/swisnl/php-http-fixture-client.svg )] ( https://github.com/swisnl/php-http-fixture-client/blob/master/LICENSE )
5
+ [ ![ Software License] ( https://img.shields.io/packagist/l/swisnl/php-http-fixture-client.svg )] ( https://github.com/swisnl/php-http-fixture-client/blob/master/LICENSE )
6
6
[ ![ Buy us a tree] ( https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen.svg )] ( https://plant.treeware.earth/swisnl/php-http-fixture-client )
7
7
[ ![ Build Status] ( https://travis-ci.org/swisnl/php-http-fixture-client.svg?branch=master )] ( https://travis-ci.org/swisnl/php-http-fixture-client )
8
8
[ ![ Scrutinizer Coverage] ( https://img.shields.io/scrutinizer/coverage/g/swisnl/php-http-fixture-client.svg )] ( https://scrutinizer-ci.com/g/swisnl/php-http-fixture-client/?branch=master )
@@ -57,6 +57,13 @@ Please see the following table for some examples.
57
57
| | | /path/to/fixtures/example.com/api/comments.get.mock |
58
58
| | | /path/to/fixtures/example.com/api/comments.mock |
59
59
60
+ ### Ignored query parameters
61
+ The ` ReponseBuilder ` can be instructed to ignore certain query parameters using ` setIgnoredQueryParameters([...]) ` .
62
+ When configured, the provided parameters will be ignored when transforming requests to file paths.
63
+ You should only provide the parameter name, not the value.
64
+ This allows you to ignore 'dynamic' parameters that change in each test execution.
65
+ Parameters are matched strictly, so 'foo' will match 'foo=bar', but not 'foo[ ] =bar'.
66
+
60
67
### Strict mode
61
68
The ` ReponseBuilder ` can be set to strict mode using ` setStrictMode(true) ` .
62
69
When in strict mode, only the first possible fixture path will be used.
@@ -68,7 +75,7 @@ This means that both the method and query params must be present in the fixture
68
75
### Body
69
76
70
77
The body of a request is loaded directly from a fixture with the file extension _ .mock_ .
71
- The contents of this file can be anything that is a valid HTTP response, e.g. HTML, JSON or even images.
78
+ The contents of this file can be anything that is a valid HTTP response, e.g. HTML, JSON or even images.
72
79
If a fixture can not be found, a ` MockNotFoundException ` will be thrown.
73
80
This exception has a convenience method ` getPossiblePaths() ` which lists all file paths that were checked, in order of specificity.
74
81
@@ -120,4 +127,4 @@ This package is [Treeware](https://treeware.earth). If you use it in production,
120
127
121
128
## SWIS :heart : Open Source
122
129
123
- [ SWIS] ( https://www.swis.nl ) is a web agency from Leiden, the Netherlands. We love working with open source software.
130
+ [ SWIS] ( https://www.swis.nl ) is a web agency from Leiden, the Netherlands. We love working with open source software.
0 commit comments