GuzzleHttp\Tests\RedirectMiddlewareTest::testEnsuresProtocolIsValid PHP Method

testEnsuresProtocolIsValid() public method

    public function testEnsuresProtocolIsValid()
    {
        $mock = new MockHandler([new Response(301, ['Location' => 'ftp://test.com'])]);
        $stack = new HandlerStack($mock);
        $stack->push(Middleware::redirect());
        $handler = $stack->resolve();
        $request = new Request('GET', 'http://example.com');
        $handler($request, ['allow_redirects' => ['max' => 3]])->wait();
    }