Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaks for the DNS-sensitive tests doc #6469

Merged
merged 1 commit into from
Apr 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions components/phpunit_bridge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ record, can be slow to execute and unreliable due to the conditions of the
network. For that reason, this component also provides mocks for these PHP
functions:

* :phpfunction:`checkdnsrr()`
* :phpfunction:`dns_check_record()`
* :phpfunction:`getmxrr()`
* :phpfunction:`dns_get_mx()`
* :phpfunction:`gethostbyaddr()`
* :phpfunction:`gethostbyname()`
* :phpfunction:`gethostbynamel()`
* :phpfunction:`dns_get_record()`
* :phpfunction:`checkdnsrr`
* :phpfunction:`dns_check_record`
* :phpfunction:`getmxrr`
* :phpfunction:`dns_get_mx`
* :phpfunction:`gethostbyaddr`
* :phpfunction:`gethostbyname`
* :phpfunction:`gethostbynamel`
* :phpfunction:`dns_get_record`

Use Case
~~~~~~~~
Expand Down Expand Up @@ -266,8 +266,10 @@ the data you expect to get for the given hosts::
// ...
}

The ``withMockedHosts()`` method can return any number of hosts with different
configuration, so you can simulate diverse network conditions::
The ``withMockedHosts()`` method configuration is defined as an array. The keys
are the mocked hosts and the values are arrays of DNS records in the same format
returned by :phpfunction:`dns_get_record`, so you can simulate diverse network
conditions:

DnsMock::withMockedHosts(array(
'example.com' => array(
Expand Down