From 7178f5ecc4d53eeee4c51537f11dbad2c7a005db Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 13 Apr 2016 11:19:00 +0200 Subject: [PATCH] Tweaks for the DNS-sensitive tests doc --- components/phpunit_bridge.rst | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/components/phpunit_bridge.rst b/components/phpunit_bridge.rst index 8e72892b974..d6c5df8b99c 100644 --- a/components/phpunit_bridge.rst +++ b/components/phpunit_bridge.rst @@ -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 ~~~~~~~~ @@ -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(