Ejemplo n.º 1
0
 function testRedirectChangesPostToGet()
 {
     $agent = new MockRequestUserAgent();
     $agent->setReturnReferenceAt(0, '_createHttpRequest', $this->createRedirect('first', 'two.html'));
     $agent->expectArgumentsAt(0, '_createHttpRequest', array('*', new IsAExpectation('SimplePostEncoding')));
     $agent->setReturnReferenceAt(1, '_createHttpRequest', $this->createRedirect('second', 'three.html'));
     $agent->expectArgumentsAt(1, '_createHttpRequest', array('*', new IsAExpectation('SimpleGetEncoding')));
     $agent->expectCallCount('_createHttpRequest', 2);
     $agent->SimpleUserAgent();
     $agent->setMaximumRedirects(1);
     $response =& $agent->fetchResponse(new SimpleUrl('one.html'), new SimplePostEncoding());
 }