You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Library hooks can only intercept HTTP requests if PHP-VCR is turned on right after initializing your autoloader, before the actual class to be replaced is loaded.
20
-
Once loaded php-vcr does not have any change to do its' magic and intercept any request and/or response invoked by this class.
21
+
Once loaded php-vcr does not have any change to do its' magic and intercept any request and/or response invoked by this class.
22
+
21
23
22
24
## Request matching
23
25
24
26
In order to replay previously recorded requests, PHP-VCR must match new HTTP requests to a recorded one. By default, it matches all aspects of a HTTP request to fully identify the resource and action. Available request matchers are:
25
27
26
28
*`method` matches the HTTP method like GET, POST, ...
27
-
*`url` matches the URI
29
+
*`url` matches the URI
28
30
*`host` matches the host name
29
31
*`headers` matches all headers
30
32
*`body` matches the request body
31
33
*`post_fields` matches any post fields
32
34
33
-
You can customize how PHP-VCR matches requests using the configuration option. List every name of a matcher that should be enabled.
35
+
You can customize how PHP-VCR matches requests using the configuration option. List every name of a matcher that should be enabled.
In special occasions, like a dedicated test scenario, you might want to exclude (blacklisting) or especially include (whitelisting) one or more methods throughout the test execution.
55
+
This can be achieved by registering the name of the methods to either the recognized blacklist:
You certainly can use both in one setup, but be aware that a method set in the whitelist rules out the same method added to the blacklist and will be processed even when added to the blacklist.
64
+
Both methods (setBlacklist() and setWhiteList()) do also follow the fluent interface paradigm mentioned above.
0 commit comments