mercredi 21 décembre 2016

How to Mock DNS with PHPUnit Bridge?

I am using PHPUnit with Laravel 5 to functionally test my API endpoints.

I noticed my tests are very slow when my laptop is connect to the internet! So I thought it could be the DNS lookup causing this delay.

I required PHPUnit Bridge to Mock the DNS but I don't know what to pass in the parameters inorder to mock my API's subdomain api.insa.dev, that's what I have so far in my TestCase setUp() function:

DnsMock::withMockedHosts([
    'insa.dev' => [
        [
            'ip' => '127.0.0.1',
            // ... ?!?!?
        ],
    ],
]);

Aucun commentaire:

Enregistrer un commentaire