Skip to content

Commit f4f7a72

Browse files
committed
Adds integration test for Amazon Polly driver.
1 parent 4be296e commit f4f7a72

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/Integration/ProviderTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,25 @@
77

88
class ProviderTest extends TestCase
99
{
10+
public function testAmazonSynthesizesExpectedContent()
11+
{
12+
$provider = Provider::instance('amazon', [
13+
'key' => $this->config['amazon_api_key'],
14+
'secret' => $this->config['amazon_api_secret'],
15+
]);
16+
$content = $provider->synthesize($this->getDataFileContents('text.txt'));
17+
18+
// Pre-signed URL is always unique. Parse params to test a few of them.
19+
parse_str(
20+
parse_url($content->audio[0], PHP_URL_QUERY),
21+
$params
22+
);
23+
24+
$this->assertInstanceOf(Content::class, $content);
25+
$this->assertContains($this->config['amazon_api_key'], $params['X-Amz-Credential']);
26+
$this->assertEquals($this->getDataFileContents('text.txt'), $params['Text']);
27+
}
28+
1029
public function testGoogleSynthesizesExpectedContent()
1130
{
1231
$provider = Provider::instance('google');

0 commit comments

Comments
 (0)