31 list($logPlugin, $request, $response) = $this->
getMocks();
33 $response = $this->getMockBuilder(
'Guzzle\Http\Message\Response')
34 ->setConstructorArgs(array(503))
35 ->setMethods(array(
'getInfo'))
38 $response->expects($this->any())
40 ->will($this->returnValue(2));
44 $event =
new Event(array(
45 'request' => $request,
46 'response' => $response,
52 $logPlugin->onRequestRetry($event);
53 $this->assertContains(
54 '] PUT http://www.example.com - 503 Service Unavailable - Retries: 1, Delay: 3, Time: 2, 2, cURL: 30 Foo',
62 $l->setTemplate(
'foo');
63 $t = $this->readAttribute($l,
'formatter');
64 $this->assertEquals(
'foo', $this->readAttribute($t,
'template'));
79 'Content-Length' => 3,
83 return array($logPlugin, $request, $response);
91 $handle = $this->getMockBuilder(
'Guzzle\Http\Curl\CurlHandle')
92 ->disableOriginalConstructor()
93 ->setMethods(array(
'getError',
'getErrorNo',
'getInfo'))
96 $handle->expects($this->once())
98 ->will($this->returnValue(
'Foo'));
100 $handle->expects($this->once())
101 ->method(
'getErrorNo')
102 ->will($this->returnValue(30));
104 $handle->expects($this->any())
106 ->will($this->returnValue(2));