public function testToStringForFailure() { $guzzleResponse = m::mock(GuzzleResponseInterface::class); $guzzleResponse->shouldReceive('getBody')->andReturn($this->toStream(TestFixtures::getFixture('failure_403'))); $response = new Response($guzzleResponse); static::assertRegExp('/Response: \\d+: \\w+ - \\d+: .+\\n.+\\n.+\\n.+/s', $response->__toString()); }
/** * ResponseCollection constructor. * * @param GuzzleResponseInterface $response */ public function __construct(GuzzleResponseInterface $response) { parent::__construct($response); $this->count = (int) $this->popField('objectsCount'); $this->total = (int) $this->popField('totalCount'); $this->nextCursor = $this->popField('nextCursorId'); $this->results = (array) $this->popField('results'); }