public function testRedirectChangesPostToGet() { $agent = new MockRequestUserAgent(); $agent->returnsAt(0, 'createHttpRequest', $this->createRedirect('first', 'two.html')); $agent->expectAt(0, 'createHttpRequest', array('*', new IsAExpectation('SimplePostEncoding'))); $agent->returnsAt(1, 'createHttpRequest', $this->createRedirect('second', 'three.html')); $agent->expectAt(1, 'createHttpRequest', array('*', new IsAExpectation('SimpleGetEncoding'))); $agent->expectCallCount('createHttpRequest', 2); $agent->__construct(); $agent->setMaximumRedirects(1); $response = $agent->fetchResponse(new SimpleUrl('one.html'), new SimplePostEncoding()); }