public function it_uploads_speech(UrlGenerator $generator, ClientInterface $client, SpeechContentInterface $speech, StreamInterface $uploadedStream, ResponseInterface $response, Uri $generatedUri) { $speech->getStream()->willReturn($uploadedStream); $speech->getContentType()->willReturn(null); $generator->generate($speech)->willReturn($generatedUri); $client->upload(Argument::type('Psr\\Http\\Message\\RequestInterface'))->willReturn($response); $this->upload($speech)->shouldReturn($response); $client->upload(Argument::type('Psr\\Http\\Message\\RequestInterface'))->shouldHaveBeenCalled(); $client->upload(Argument::which('getBody', $uploadedStream->getWrappedObject()))->shouldHaveBeenCalled(); }