public function testReadStream() { $resource = tmpfile(); $container = $this->getContainerMock(); $dataObject = $this->getDataObjectMock('filename.ext'); $body = Mockery::mock('Guzzle\\Http\\EntityBody'); $body->shouldReceive('close'); $body->shouldReceive('getStream')->andReturn($resource); $body->shouldReceive('detachStream'); $dataObject->shouldReceive('getContent')->andReturn($body); $container->shouldReceive('getObject')->andReturn($dataObject); $adapter = new Rackspace($container); $response = $adapter->readStream('filename.ext'); $this->assertInternalType('array', $response); $this->assertEquals($resource, $response['stream']); fclose($resource); }