20 $this->assertTrue(class_exists(
'FooBazBar'));
21 $this->assertSame($client, $this->readAttribute(
'Guzzle\Http\StaticClient',
'client'));
27 function ($m) {
return array($m); },
28 array(
'GET',
'POST',
'PUT',
'DELETE',
'PATCH',
'HEAD',
'OPTIONS')
38 call_user_func(
'Guzzle\Http\StaticClient::' . $method,
'http://foo.com', array(
39 'plugins' => array($mock)
41 $requests = $mock->getReceivedRequests();
42 $this->assertCount(1, $requests);
43 $this->assertEquals($method, $requests[0]->getMethod());
48 $this->
getServer()->enqueue(array(
"HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest"));
50 $this->assertInstanceOf(
'Guzzle\Stream\StreamInterface', $stream);
51 $this->assertEquals(
'test', (
string) $stream);
56 $stream = $this->getMockBuilder(
'Guzzle\Stream\StreamRequestFactoryInterface')
57 ->setMethods(array(
'fromRequest'))
58 ->getMockForAbstractClass();
59 $resource =
new Stream(fopen(
'php://temp',
'r+'));
60 $stream->expects($this->once())
61 ->method(
'fromRequest')
62 ->will($this->returnValue($resource));
63 $this->
getServer()->enqueue(array(
"HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest"));
65 $this->assertSame($resource, $result);