Dshafik\GuzzleHttp\Tests\VcrHandlerTest::testExisting PHP Method

testExisting() public method

public testExisting ( )
    public function testExisting()
    {
        $vcr = \Dshafik\GuzzleHttp\VcrHandler::turnOn(__DIR__ . '/fixtures/test-existing.json');
        $client = new \GuzzleHttp\Client(['handler' => $vcr]);
        $response = $client->get('/test');
        $this->assertEquals(200, $response->getStatusCode());
        $this->assertArrayHasKey('X-VCR-Recording', $response->getHeaders());
        $this->assertEquals("1440121471", $response->getHeader('X-VCR-Recording')[0]);
        $this->assertEquals('Hello World', (string) $response->getBody());
    }