Goutte\Tests\ClientTest::testRestart PHP Method

testRestart() public method

public testRestart ( )
    public function testRestart()
    {
        $client = new Client();
        $client->setHeader('X-Test', 'test');
        $client->setAuth('foo', 'bar');
        $headersReflectionProperty = new \ReflectionProperty('Goutte\\Client', 'headers');
        $headersReflectionProperty->setAccessible(true);
        $this->assertEquals(array('X-Test' => 'test'), $headersReflectionProperty->getValue($client));
        $authReflectionProperty = new \ReflectionProperty('Goutte\\Client', 'auth');
        $authReflectionProperty->setAccessible(true);
        $this->assertEquals(array('foo', 'bar', 'basic'), $authReflectionProperty->getValue($client));
        $client->restart();
        $this->assertEquals([], $headersReflectionProperty->getValue($client));
        $this->assertNull($authReflectionProperty->getValue($client));
    }