/** * Tweet by optionally uploading media and updating status. * * @param Tweet $tweet */ public function tweet(Tweet $tweet) { if ($tweet->getMedia() instanceof StreamInterface) { $tweet = $this->mediaUploader->upload($tweet); } $this->statusUpdater->update($tweet); }
/** * Test GuzzleClient with good response. */ public function testGuzzleClientResponseGood() { $response = $this->getMock('GuzzleHttp\\Psr7\\Response'); $response->method('getStatusCode')->willReturn(200); $this->guzzleClient->method('send')->willReturn($response); $stream = $this->getMock('Psr\\Http\\Message\\StreamInterface'); $tweet = $this->getMock('JimLind\\Pie7o\\Tweet'); $tweet->method('getMessage')->willReturn($stream); $actual = $this->fixture->update($tweet); $this->assertNull($actual); }