diff --git a/tests/Providers/AbstractProviderTest.php b/tests/Providers/AbstractProviderTest.php index b15f65f..03e0c7e 100644 --- a/tests/Providers/AbstractProviderTest.php +++ b/tests/Providers/AbstractProviderTest.php @@ -4,6 +4,7 @@ use duncan3dc\Speaker\Exceptions\ProviderException; use GuzzleHttp\ClientInterface; +use GuzzleHttp\Psr7\Utils; use Mockery; use Mockery\MockInterface; use PHPUnit\Framework\TestCase; @@ -55,7 +56,7 @@ public function testSendRequest(): void { $response = Mockery::mock(ResponseInterface::class); $response->shouldReceive("getStatusCode")->once()->andReturn("200"); - $response->shouldReceive("getBody")->once()->andReturn("mp3"); + $response->shouldReceive("getBody")->once()->andReturn(Utils::streamFor("mp3")); $this->client->shouldReceive("request") ->once() diff --git a/tests/Providers/AcapelaProviderTest.php b/tests/Providers/AcapelaProviderTest.php index af1af4c..de90396 100644 --- a/tests/Providers/AcapelaProviderTest.php +++ b/tests/Providers/AcapelaProviderTest.php @@ -5,6 +5,7 @@ use duncan3dc\Speaker\Exceptions\InvalidArgumentException; use duncan3dc\Speaker\Providers\AcapelaProvider; use GuzzleHttp\ClientInterface; +use GuzzleHttp\Psr7\Utils; use Mockery; use Mockery\MockInterface; use PHPUnit\Framework\TestCase; @@ -37,7 +38,7 @@ public function testTextToSpeech(): void { $response = Mockery::mock(ResponseInterface::class); $response->shouldReceive("getStatusCode")->once()->andReturn("200"); - $response->shouldReceive("getBody")->once()->andReturn("mp3"); + $response->shouldReceive("getBody")->once()->andReturn(Utils::streamFor("mp3")); $this->client->shouldReceive("request") ->once() @@ -58,7 +59,7 @@ public function testWithVoice(): void $response = Mockery::mock(ResponseInterface::class); $response->shouldReceive("getStatusCode")->once()->andReturn("200"); - $response->shouldReceive("getBody")->once()->andReturn("mp3"); + $response->shouldReceive("getBody")->once()->andReturn(Utils::streamFor("mp3")); $this->client->shouldReceive("request") ->once() @@ -87,7 +88,7 @@ public function testWithSpeed(): void $response = Mockery::mock(ResponseInterface::class); $response->shouldReceive("getStatusCode")->once()->andReturn("200"); - $response->shouldReceive("getBody")->once()->andReturn("mp3"); + $response->shouldReceive("getBody")->once()->andReturn(Utils::streamFor("mp3")); $this->client->shouldReceive("request") ->once() diff --git a/tests/Providers/GoogleProviderTest.php b/tests/Providers/GoogleProviderTest.php index 3e70cdb..b4a4d0b 100644 --- a/tests/Providers/GoogleProviderTest.php +++ b/tests/Providers/GoogleProviderTest.php @@ -5,6 +5,7 @@ use duncan3dc\Speaker\Exceptions\InvalidArgumentException; use duncan3dc\Speaker\Providers\GoogleProvider; use GuzzleHttp\ClientInterface; +use GuzzleHttp\Psr7\Utils; use Mockery; use Mockery\MockInterface; use PHPUnit\Framework\TestCase; @@ -37,7 +38,7 @@ public function testTextToSpeech(): void { $response = Mockery::mock(ResponseInterface::class); $response->shouldReceive("getStatusCode")->once()->andReturn("200"); - $response->shouldReceive("getBody")->once()->andReturn("mp3"); + $response->shouldReceive("getBody")->once()->andReturn(Utils::streamFor("mp3")); $this->client->shouldReceive("request") ->once() @@ -58,7 +59,7 @@ public function testWithLanguage(): void $response = Mockery::mock(ResponseInterface::class); $response->shouldReceive("getStatusCode")->once()->andReturn("200"); - $response->shouldReceive("getBody")->once()->andReturn("mp3"); + $response->shouldReceive("getBody")->once()->andReturn(Utils::streamFor("mp3")); $this->client->shouldReceive("request") ->once() diff --git a/tests/Providers/ResponsiveVoiceProviderTest.php b/tests/Providers/ResponsiveVoiceProviderTest.php index 041511a..8e629e6 100644 --- a/tests/Providers/ResponsiveVoiceProviderTest.php +++ b/tests/Providers/ResponsiveVoiceProviderTest.php @@ -5,6 +5,7 @@ use duncan3dc\Speaker\Exceptions\InvalidArgumentException; use duncan3dc\Speaker\Providers\ResponsiveVoiceProvider; use GuzzleHttp\ClientInterface; +use GuzzleHttp\Psr7\Utils; use Mockery; use Mockery\MockInterface; use PHPUnit\Framework\TestCase; @@ -37,7 +38,7 @@ public function testTextToSpeech(): void { $response = Mockery::mock(ResponseInterface::class); $response->shouldReceive("getStatusCode")->once()->andReturn("200"); - $response->shouldReceive("getBody")->once()->andReturn("mp3"); + $response->shouldReceive("getBody")->once()->andReturn(Utils::streamFor("mp3")); $this->client->shouldReceive("request") ->once() diff --git a/tests/Providers/VoiceRssProviderTest.php b/tests/Providers/VoiceRssProviderTest.php index 6e763fa..01de5f7 100644 --- a/tests/Providers/VoiceRssProviderTest.php +++ b/tests/Providers/VoiceRssProviderTest.php @@ -6,6 +6,7 @@ use duncan3dc\Speaker\Exceptions\ProviderException; use duncan3dc\Speaker\Providers\VoiceRssProvider; use GuzzleHttp\ClientInterface; +use GuzzleHttp\Psr7\Utils; use Mockery; use Mockery\MockInterface; use PHPUnit\Framework\TestCase; @@ -38,7 +39,7 @@ public function testTextToSpeech(): void { $response = Mockery::mock(ResponseInterface::class); $response->shouldReceive("getStatusCode")->once()->andReturn("200"); - $response->shouldReceive("getBody")->once()->andReturn("mp3"); + $response->shouldReceive("getBody")->once()->andReturn(Utils::streamFor("mp3")); $this->client->shouldReceive("request") ->once() @@ -53,7 +54,7 @@ public function testTextToSpeechFailure(): void { $response = Mockery::mock(ResponseInterface::class); $response->shouldReceive("getStatusCode")->once()->andReturn("200"); - $response->shouldReceive("getBody")->once()->andReturn("ERROR: Test Message"); + $response->shouldReceive("getBody")->once()->andReturn(Utils::streamFor("ERROR: Test Message")); $this->client->shouldReceive("request") ->once() @@ -76,7 +77,7 @@ public function testWithLanguage(): void $response = Mockery::mock(ResponseInterface::class); $response->shouldReceive("getStatusCode")->once()->andReturn("200"); - $response->shouldReceive("getBody")->once()->andReturn("mp3"); + $response->shouldReceive("getBody")->once()->andReturn(Utils::streamFor("mp3")); $this->client->shouldReceive("request") ->once() @@ -105,7 +106,7 @@ public function testWithSpeed(): void $response = Mockery::mock(ResponseInterface::class); $response->shouldReceive("getStatusCode")->once()->andReturn("200"); - $response->shouldReceive("getBody")->once()->andReturn("mp3"); + $response->shouldReceive("getBody")->once()->andReturn(Utils::streamFor("mp3")); $this->client->shouldReceive("request") ->once()