Skip to content

Commit 26029c7

Browse files
committed
Merge pull request #3 from php-vcr/f-white-blacklist
Documented: White- and blacklisting are actually paths, not methods.
2 parents 8460fd7 + 671ebd4 commit 26029c7

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

documentation/_posts/2013-10-20-configuration.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,15 @@ PHP-VCR allows you to define your own request matchers as callback functions and
4949
)
5050
->enableRequestMatchers(array('method', 'url', 'custom_matcher'));
5151

52-
## White- and Blacklisting methods
52+
## White- and Blacklisting paths
5353

54-
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:
54+
PHP-VCR scans and overwrites your PHP code on-the-fly in order to hook into libraries like cUrl and SOAP. By default all paths except the PHP-VCR library hooks folder are scanned.
5655

57-
\VCR\VCR::configure()->setBlackList(array('NameOfTheSpecialMethod'));
56+
To speedup the test execution, you might want to exclude (blacklist) or specifically include (whitelist) one or more paths to be scanned throughout the test execution:
5857

59-
or the provided whitelist:
58+
\VCR\VCR::configure()
59+
->setBlackList(array('do/not/scan/this/path'))
60+
->setWhiteList(array('vendor/guzzle'));
6061

61-
VCR\VCR::configure()->setWhiteList(array('NameOfTheSpecialMethod'));
62-
63-
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.
62+
Paths you provide are substrings. For example if `vendor\guzzle` is on the whitelist, only files containing that path are scanned – think of `*vendor\guzzle*`.
63+
You certainly can use white- and blacklisting in one setup, but be aware that a PHP-VCR scans and overwrites paths only if they are in a whitelist and not on a blacklist.

0 commit comments

Comments
 (0)