/** * @expectedException InvalidArgumentException * @expectedExceptionMessage Could not generate short URL */ public function testThrowsExceptionWhenTryingToGetShortUrlAndGenerateShortUrlFails() { $this->setMockResponse($this->client, new Response(400)); $url = $this->client->getShortUrl($this->client->getImageUrl('image')); }