| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,196 @@ |
| 1 |
+<?php |
|
| 2 |
+namespace XML; |
|
| 3 |
+ |
|
| 4 |
+use Plivo\XML\Response; |
|
| 5 |
+use Plivo\Tests\BaseTestCase; |
|
| 6 |
+ |
|
| 7 |
+/** |
|
| 8 |
+ * Class ProsodyTest |
|
| 9 |
+ * @package Plivo\Tests\XML |
|
| 10 |
+ */ |
|
| 11 |
+class ProsodyTest extends BaseTestCase |
|
| 12 |
+{
|
|
| 13 |
+ |
|
| 14 |
+ function testAddProsody() |
|
| 15 |
+ {
|
|
| 16 |
+ $response = new Response(); |
|
| 17 |
+ $params1 = array( |
|
| 18 |
+ 'language' => 'en-US', |
|
| 19 |
+ 'voice' => 'Polly.Joanna' |
|
| 20 |
+ ); |
|
| 21 |
+ |
|
| 22 |
+ $params2 = array( |
|
| 23 |
+ 'volume' => 'loud', |
|
| 24 |
+ 'rate' => 'medium', |
|
| 25 |
+ 'pitch' => 'high' |
|
| 26 |
+ ); |
|
| 27 |
+ |
|
| 28 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 29 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 30 |
+ $ssml = $response->toXML(true); |
|
| 31 |
+ // $actual = new \DOMDocument; |
|
| 32 |
+ // $actual->loadXML($ssml); |
|
| 33 |
+ |
|
| 34 |
+ self::assertNotNull($ssml); |
|
| 35 |
+ |
|
| 36 |
+ self::assertXmlStringEqualsXmlFile(__DIR__ . '/../Mocks/prosodySpeak.xml',$ssml); |
|
| 37 |
+ } |
|
| 38 |
+ |
|
| 39 |
+ function testExceptionAddProsody() |
|
| 40 |
+ {
|
|
| 41 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 42 |
+ $response = new Response(); |
|
| 43 |
+ $params1 = array( |
|
| 44 |
+ 'language' => 'en-US', |
|
| 45 |
+ 'voice' => 'Polly.Joanna' |
|
| 46 |
+ ); |
|
| 47 |
+ |
|
| 48 |
+ $params2 = array( |
|
| 49 |
+ 'volume' => 'loud', |
|
| 50 |
+ 'rate' => 'medium', |
|
| 51 |
+ 'pitch' => 'high' |
|
| 52 |
+ ); |
|
| 53 |
+ |
|
| 54 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 55 |
+ ->addProsody('',$params2);
|
|
| 56 |
+ $ssml = $response->toXML(true); |
|
| 57 |
+ } |
|
| 58 |
+ |
|
| 59 |
+ function testExceptionAttributeVolumeAddProsody() |
|
| 60 |
+ {
|
|
| 61 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 62 |
+ $response = new Response(); |
|
| 63 |
+ $params1 = array( |
|
| 64 |
+ 'language' => 'en-US', |
|
| 65 |
+ 'voice' => 'Polly.Joanna' |
|
| 66 |
+ ); |
|
| 67 |
+ |
|
| 68 |
+ $params2 = array( |
|
| 69 |
+ 'volumes' => 'loud', |
|
| 70 |
+ 'rate' => 'medium', |
|
| 71 |
+ 'pitch' => 'high' |
|
| 72 |
+ ); |
|
| 73 |
+ |
|
| 74 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 75 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 76 |
+ $ssml = $response->toXML(true); |
|
| 77 |
+ } |
|
| 78 |
+ |
|
| 79 |
+ function testExceptionAttributeRateAddProsody() |
|
| 80 |
+ {
|
|
| 81 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 82 |
+ $response = new Response(); |
|
| 83 |
+ $params1 = array( |
|
| 84 |
+ 'language' => 'en-US', |
|
| 85 |
+ 'voice' => 'Polly.Joanna' |
|
| 86 |
+ ); |
|
| 87 |
+ |
|
| 88 |
+ $params2 = array( |
|
| 89 |
+ 'volume' => 'loud', |
|
| 90 |
+ 'rates' => 'medium', |
|
| 91 |
+ 'pitch' => 'high' |
|
| 92 |
+ ); |
|
| 93 |
+ |
|
| 94 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 95 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 96 |
+ $ssml = $response->toXML(true); |
|
| 97 |
+ } |
|
| 98 |
+ |
|
| 99 |
+ function testExceptionAttributePitchAddProsody() |
|
| 100 |
+ {
|
|
| 101 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 102 |
+ $response = new Response(); |
|
| 103 |
+ $params1 = array( |
|
| 104 |
+ 'language' => 'en-US', |
|
| 105 |
+ 'voice' => 'Polly.Joanna' |
|
| 106 |
+ ); |
|
| 107 |
+ |
|
| 108 |
+ $params2 = array( |
|
| 109 |
+ 'volume' => 'loud', |
|
| 110 |
+ 'rate' => 'medium', |
|
| 111 |
+ 'pitchs' => 'high' |
|
| 112 |
+ ); |
|
| 113 |
+ |
|
| 114 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 115 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 116 |
+ $ssml = $response->toXML(true); |
|
| 117 |
+ } |
|
| 118 |
+ |
|
| 119 |
+ function testExceptionAttributeVolumeValueAddProsody() |
|
| 120 |
+ {
|
|
| 121 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 122 |
+ $response = new Response(); |
|
| 123 |
+ $params1 = array( |
|
| 124 |
+ 'language' => 'en-US', |
|
| 125 |
+ 'voice' => 'Polly.Joanna' |
|
| 126 |
+ ); |
|
| 127 |
+ |
|
| 128 |
+ $params2 = array( |
|
| 129 |
+ 'volume' => 'louds', |
|
| 130 |
+ 'rate' => 'medium', |
|
| 131 |
+ 'pitch' => 'high' |
|
| 132 |
+ ); |
|
| 133 |
+ |
|
| 134 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 135 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 136 |
+ $ssml = $response->toXML(true); |
|
| 137 |
+ } |
|
| 138 |
+ |
|
| 139 |
+ function testExceptionAttributeRateValueAddProsody() |
|
| 140 |
+ {
|
|
| 141 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 142 |
+ $response = new Response(); |
|
| 143 |
+ $params1 = array( |
|
| 144 |
+ 'language' => 'en-US', |
|
| 145 |
+ 'voice' => 'Polly.Joanna' |
|
| 146 |
+ ); |
|
| 147 |
+ |
|
| 148 |
+ $params2 = array( |
|
| 149 |
+ 'volume' => 'loud', |
|
| 150 |
+ 'rate' => 'mediums', |
|
| 151 |
+ 'pitch' => 'high' |
|
| 152 |
+ ); |
|
| 153 |
+ |
|
| 154 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 155 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 156 |
+ $ssml = $response->toXML(true); |
|
| 157 |
+ } |
|
| 158 |
+ |
|
| 159 |
+ function testExceptionAttributePitchValueAddProsody() |
|
| 160 |
+ {
|
|
| 161 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 162 |
+ $response = new Response(); |
|
| 163 |
+ $params1 = array( |
|
| 164 |
+ 'language' => 'en-US', |
|
| 165 |
+ 'voice' => 'Polly.Joanna' |
|
| 166 |
+ ); |
|
| 167 |
+ |
|
| 168 |
+ $params2 = array( |
|
| 169 |
+ 'volume' => 'loud', |
|
| 170 |
+ 'rate' => 'medium', |
|
| 171 |
+ 'pitch' => 'highs' |
|
| 172 |
+ ); |
|
| 173 |
+ |
|
| 174 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 175 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 176 |
+ $ssml = $response->toXML(true); |
|
| 177 |
+ } |
|
| 178 |
+ |
|
| 179 |
+ function testExceptionSSMLSupported() |
|
| 180 |
+ {
|
|
| 181 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 182 |
+ $response = new Response(); |
|
| 183 |
+ $params1 = array( |
|
| 184 |
+ 'language' => 'en-US' |
|
| 185 |
+ ); |
|
| 186 |
+ |
|
| 187 |
+ $params2 = array( |
|
| 188 |
+ 'volume' => 'loud', |
|
| 189 |
+ 'rate' => 'medium', |
|
| 190 |
+ 'pitchs' => 'high' |
|
| 191 |
+ ); |
|
| 192 |
+ |
|
| 193 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 194 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 195 |
+ } |
|
| 196 |
+} |
|
| 0 | 197 |
\ No newline at end of file |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,196 +0,0 @@ |
| 1 |
-<?php |
|
| 2 |
-namespace XML; |
|
| 3 |
- |
|
| 4 |
-use Plivo\XML\Response; |
|
| 5 |
-use Plivo\Tests\BaseTestCase; |
|
| 6 |
- |
|
| 7 |
-/** |
|
| 8 |
- * Class ProsodyTest |
|
| 9 |
- * @package Plivo\Tests\XML |
|
| 10 |
- */ |
|
| 11 |
-class ProsodyTest extends BaseTestCase |
|
| 12 |
-{
|
|
| 13 |
- |
|
| 14 |
- function testAddProsody() |
|
| 15 |
- {
|
|
| 16 |
- $response = new Response(); |
|
| 17 |
- $params1 = array( |
|
| 18 |
- 'language' => 'en-US', |
|
| 19 |
- 'voice' => 'Polly.Joanna' |
|
| 20 |
- ); |
|
| 21 |
- |
|
| 22 |
- $params2 = array( |
|
| 23 |
- 'volume' => 'loud', |
|
| 24 |
- 'rate' => 'medium', |
|
| 25 |
- 'pitch' => 'high' |
|
| 26 |
- ); |
|
| 27 |
- |
|
| 28 |
- $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 29 |
- ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 30 |
- $ssml = $response->toXML(true); |
|
| 31 |
- // $actual = new \DOMDocument; |
|
| 32 |
- // $actual->loadXML($ssml); |
|
| 33 |
- |
|
| 34 |
- self::assertNotNull($ssml); |
|
| 35 |
- |
|
| 36 |
- self::assertXmlStringEqualsXmlFile(__DIR__ . '/../Mocks/prosodySpeak.xml',$ssml); |
|
| 37 |
- } |
|
| 38 |
- |
|
| 39 |
- function testExceptionAddProsody() |
|
| 40 |
- {
|
|
| 41 |
- $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 42 |
- $response = new Response(); |
|
| 43 |
- $params1 = array( |
|
| 44 |
- 'language' => 'en-US', |
|
| 45 |
- 'voice' => 'Polly.Joanna' |
|
| 46 |
- ); |
|
| 47 |
- |
|
| 48 |
- $params2 = array( |
|
| 49 |
- 'volume' => 'loud', |
|
| 50 |
- 'rate' => 'medium', |
|
| 51 |
- 'pitch' => 'high' |
|
| 52 |
- ); |
|
| 53 |
- |
|
| 54 |
- $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 55 |
- ->addProsody('',$params2);
|
|
| 56 |
- $ssml = $response->toXML(true); |
|
| 57 |
- } |
|
| 58 |
- |
|
| 59 |
- function testExceptionAttributeVolumeAddProsody() |
|
| 60 |
- {
|
|
| 61 |
- $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 62 |
- $response = new Response(); |
|
| 63 |
- $params1 = array( |
|
| 64 |
- 'language' => 'en-US', |
|
| 65 |
- 'voice' => 'Polly.Joanna' |
|
| 66 |
- ); |
|
| 67 |
- |
|
| 68 |
- $params2 = array( |
|
| 69 |
- 'volumes' => 'loud', |
|
| 70 |
- 'rate' => 'medium', |
|
| 71 |
- 'pitch' => 'high' |
|
| 72 |
- ); |
|
| 73 |
- |
|
| 74 |
- $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 75 |
- ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 76 |
- $ssml = $response->toXML(true); |
|
| 77 |
- } |
|
| 78 |
- |
|
| 79 |
- function testExceptionAttributeRateAddProsody() |
|
| 80 |
- {
|
|
| 81 |
- $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 82 |
- $response = new Response(); |
|
| 83 |
- $params1 = array( |
|
| 84 |
- 'language' => 'en-US', |
|
| 85 |
- 'voice' => 'Polly.Joanna' |
|
| 86 |
- ); |
|
| 87 |
- |
|
| 88 |
- $params2 = array( |
|
| 89 |
- 'volume' => 'loud', |
|
| 90 |
- 'rates' => 'medium', |
|
| 91 |
- 'pitch' => 'high' |
|
| 92 |
- ); |
|
| 93 |
- |
|
| 94 |
- $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 95 |
- ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 96 |
- $ssml = $response->toXML(true); |
|
| 97 |
- } |
|
| 98 |
- |
|
| 99 |
- function testExceptionAttributePitchAddProsody() |
|
| 100 |
- {
|
|
| 101 |
- $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 102 |
- $response = new Response(); |
|
| 103 |
- $params1 = array( |
|
| 104 |
- 'language' => 'en-US', |
|
| 105 |
- 'voice' => 'Polly.Joanna' |
|
| 106 |
- ); |
|
| 107 |
- |
|
| 108 |
- $params2 = array( |
|
| 109 |
- 'volume' => 'loud', |
|
| 110 |
- 'rate' => 'medium', |
|
| 111 |
- 'pitchs' => 'high' |
|
| 112 |
- ); |
|
| 113 |
- |
|
| 114 |
- $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 115 |
- ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 116 |
- $ssml = $response->toXML(true); |
|
| 117 |
- } |
|
| 118 |
- |
|
| 119 |
- function testExceptionAttributeVolumeValueAddProsody() |
|
| 120 |
- {
|
|
| 121 |
- $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 122 |
- $response = new Response(); |
|
| 123 |
- $params1 = array( |
|
| 124 |
- 'language' => 'en-US', |
|
| 125 |
- 'voice' => 'Polly.Joanna' |
|
| 126 |
- ); |
|
| 127 |
- |
|
| 128 |
- $params2 = array( |
|
| 129 |
- 'volume' => 'louds', |
|
| 130 |
- 'rate' => 'medium', |
|
| 131 |
- 'pitch' => 'high' |
|
| 132 |
- ); |
|
| 133 |
- |
|
| 134 |
- $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 135 |
- ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 136 |
- $ssml = $response->toXML(true); |
|
| 137 |
- } |
|
| 138 |
- |
|
| 139 |
- function testExceptionAttributeRateValueAddProsody() |
|
| 140 |
- {
|
|
| 141 |
- $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 142 |
- $response = new Response(); |
|
| 143 |
- $params1 = array( |
|
| 144 |
- 'language' => 'en-US', |
|
| 145 |
- 'voice' => 'Polly.Joanna' |
|
| 146 |
- ); |
|
| 147 |
- |
|
| 148 |
- $params2 = array( |
|
| 149 |
- 'volume' => 'loud', |
|
| 150 |
- 'rate' => 'mediums', |
|
| 151 |
- 'pitch' => 'high' |
|
| 152 |
- ); |
|
| 153 |
- |
|
| 154 |
- $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 155 |
- ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 156 |
- $ssml = $response->toXML(true); |
|
| 157 |
- } |
|
| 158 |
- |
|
| 159 |
- function testExceptionAttributePitchValueAddProsody() |
|
| 160 |
- {
|
|
| 161 |
- $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 162 |
- $response = new Response(); |
|
| 163 |
- $params1 = array( |
|
| 164 |
- 'language' => 'en-US', |
|
| 165 |
- 'voice' => 'Polly.Joanna' |
|
| 166 |
- ); |
|
| 167 |
- |
|
| 168 |
- $params2 = array( |
|
| 169 |
- 'volume' => 'loud', |
|
| 170 |
- 'rate' => 'medium', |
|
| 171 |
- 'pitch' => 'highs' |
|
| 172 |
- ); |
|
| 173 |
- |
|
| 174 |
- $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 175 |
- ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 176 |
- $ssml = $response->toXML(true); |
|
| 177 |
- } |
|
| 178 |
- |
|
| 179 |
- function testExceptionSSMLSupported() |
|
| 180 |
- {
|
|
| 181 |
- $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 182 |
- $response = new Response(); |
|
| 183 |
- $params1 = array( |
|
| 184 |
- 'language' => 'en-US' |
|
| 185 |
- ); |
|
| 186 |
- |
|
| 187 |
- $params2 = array( |
|
| 188 |
- 'volume' => 'loud', |
|
| 189 |
- 'rate' => 'medium', |
|
| 190 |
- 'pitchs' => 'high' |
|
| 191 |
- ); |
|
| 192 |
- |
|
| 193 |
- $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 194 |
- ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 195 |
- } |
|
| 196 |
-} |
|
| 197 | 0 |
\ No newline at end of file |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,196 @@ |
| 1 |
+<?php |
|
| 2 |
+namespace XML; |
|
| 3 |
+ |
|
| 4 |
+use Plivo\XML\Response; |
|
| 5 |
+use Plivo\Tests\BaseTestCase; |
|
| 6 |
+ |
|
| 7 |
+/** |
|
| 8 |
+ * Class ProsodyTest |
|
| 9 |
+ * @package Plivo\Tests\XML |
|
| 10 |
+ */ |
|
| 11 |
+class ProsodyTest extends BaseTestCase |
|
| 12 |
+{
|
|
| 13 |
+ |
|
| 14 |
+ function testAddProsody() |
|
| 15 |
+ {
|
|
| 16 |
+ $response = new Response(); |
|
| 17 |
+ $params1 = array( |
|
| 18 |
+ 'language' => 'en-US', |
|
| 19 |
+ 'voice' => 'Polly.Joanna' |
|
| 20 |
+ ); |
|
| 21 |
+ |
|
| 22 |
+ $params2 = array( |
|
| 23 |
+ 'volume' => 'loud', |
|
| 24 |
+ 'rate' => 'medium', |
|
| 25 |
+ 'pitch' => 'high' |
|
| 26 |
+ ); |
|
| 27 |
+ |
|
| 28 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 29 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 30 |
+ $ssml = $response->toXML(true); |
|
| 31 |
+ // $actual = new \DOMDocument; |
|
| 32 |
+ // $actual->loadXML($ssml); |
|
| 33 |
+ |
|
| 34 |
+ self::assertNotNull($ssml); |
|
| 35 |
+ |
|
| 36 |
+ self::assertXmlStringEqualsXmlFile(__DIR__ . '/../Mocks/prosodySpeak.xml',$ssml); |
|
| 37 |
+ } |
|
| 38 |
+ |
|
| 39 |
+ function testExceptionAddProsody() |
|
| 40 |
+ {
|
|
| 41 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 42 |
+ $response = new Response(); |
|
| 43 |
+ $params1 = array( |
|
| 44 |
+ 'language' => 'en-US', |
|
| 45 |
+ 'voice' => 'Polly.Joanna' |
|
| 46 |
+ ); |
|
| 47 |
+ |
|
| 48 |
+ $params2 = array( |
|
| 49 |
+ 'volume' => 'loud', |
|
| 50 |
+ 'rate' => 'medium', |
|
| 51 |
+ 'pitch' => 'high' |
|
| 52 |
+ ); |
|
| 53 |
+ |
|
| 54 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 55 |
+ ->addProsody('',$params2);
|
|
| 56 |
+ $ssml = $response->toXML(true); |
|
| 57 |
+ } |
|
| 58 |
+ |
|
| 59 |
+ function testExceptionAttributeVolumeAddProsody() |
|
| 60 |
+ {
|
|
| 61 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 62 |
+ $response = new Response(); |
|
| 63 |
+ $params1 = array( |
|
| 64 |
+ 'language' => 'en-US', |
|
| 65 |
+ 'voice' => 'Polly.Joanna' |
|
| 66 |
+ ); |
|
| 67 |
+ |
|
| 68 |
+ $params2 = array( |
|
| 69 |
+ 'volumes' => 'loud', |
|
| 70 |
+ 'rate' => 'medium', |
|
| 71 |
+ 'pitch' => 'high' |
|
| 72 |
+ ); |
|
| 73 |
+ |
|
| 74 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 75 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 76 |
+ $ssml = $response->toXML(true); |
|
| 77 |
+ } |
|
| 78 |
+ |
|
| 79 |
+ function testExceptionAttributeRateAddProsody() |
|
| 80 |
+ {
|
|
| 81 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 82 |
+ $response = new Response(); |
|
| 83 |
+ $params1 = array( |
|
| 84 |
+ 'language' => 'en-US', |
|
| 85 |
+ 'voice' => 'Polly.Joanna' |
|
| 86 |
+ ); |
|
| 87 |
+ |
|
| 88 |
+ $params2 = array( |
|
| 89 |
+ 'volume' => 'loud', |
|
| 90 |
+ 'rates' => 'medium', |
|
| 91 |
+ 'pitch' => 'high' |
|
| 92 |
+ ); |
|
| 93 |
+ |
|
| 94 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 95 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 96 |
+ $ssml = $response->toXML(true); |
|
| 97 |
+ } |
|
| 98 |
+ |
|
| 99 |
+ function testExceptionAttributePitchAddProsody() |
|
| 100 |
+ {
|
|
| 101 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 102 |
+ $response = new Response(); |
|
| 103 |
+ $params1 = array( |
|
| 104 |
+ 'language' => 'en-US', |
|
| 105 |
+ 'voice' => 'Polly.Joanna' |
|
| 106 |
+ ); |
|
| 107 |
+ |
|
| 108 |
+ $params2 = array( |
|
| 109 |
+ 'volume' => 'loud', |
|
| 110 |
+ 'rate' => 'medium', |
|
| 111 |
+ 'pitchs' => 'high' |
|
| 112 |
+ ); |
|
| 113 |
+ |
|
| 114 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 115 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 116 |
+ $ssml = $response->toXML(true); |
|
| 117 |
+ } |
|
| 118 |
+ |
|
| 119 |
+ function testExceptionAttributeVolumeValueAddProsody() |
|
| 120 |
+ {
|
|
| 121 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 122 |
+ $response = new Response(); |
|
| 123 |
+ $params1 = array( |
|
| 124 |
+ 'language' => 'en-US', |
|
| 125 |
+ 'voice' => 'Polly.Joanna' |
|
| 126 |
+ ); |
|
| 127 |
+ |
|
| 128 |
+ $params2 = array( |
|
| 129 |
+ 'volume' => 'louds', |
|
| 130 |
+ 'rate' => 'medium', |
|
| 131 |
+ 'pitch' => 'high' |
|
| 132 |
+ ); |
|
| 133 |
+ |
|
| 134 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 135 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 136 |
+ $ssml = $response->toXML(true); |
|
| 137 |
+ } |
|
| 138 |
+ |
|
| 139 |
+ function testExceptionAttributeRateValueAddProsody() |
|
| 140 |
+ {
|
|
| 141 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 142 |
+ $response = new Response(); |
|
| 143 |
+ $params1 = array( |
|
| 144 |
+ 'language' => 'en-US', |
|
| 145 |
+ 'voice' => 'Polly.Joanna' |
|
| 146 |
+ ); |
|
| 147 |
+ |
|
| 148 |
+ $params2 = array( |
|
| 149 |
+ 'volume' => 'loud', |
|
| 150 |
+ 'rate' => 'mediums', |
|
| 151 |
+ 'pitch' => 'high' |
|
| 152 |
+ ); |
|
| 153 |
+ |
|
| 154 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 155 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 156 |
+ $ssml = $response->toXML(true); |
|
| 157 |
+ } |
|
| 158 |
+ |
|
| 159 |
+ function testExceptionAttributePitchValueAddProsody() |
|
| 160 |
+ {
|
|
| 161 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 162 |
+ $response = new Response(); |
|
| 163 |
+ $params1 = array( |
|
| 164 |
+ 'language' => 'en-US', |
|
| 165 |
+ 'voice' => 'Polly.Joanna' |
|
| 166 |
+ ); |
|
| 167 |
+ |
|
| 168 |
+ $params2 = array( |
|
| 169 |
+ 'volume' => 'loud', |
|
| 170 |
+ 'rate' => 'medium', |
|
| 171 |
+ 'pitch' => 'highs' |
|
| 172 |
+ ); |
|
| 173 |
+ |
|
| 174 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 175 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 176 |
+ $ssml = $response->toXML(true); |
|
| 177 |
+ } |
|
| 178 |
+ |
|
| 179 |
+ function testExceptionSSMLSupported() |
|
| 180 |
+ {
|
|
| 181 |
+ $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
|
|
| 182 |
+ $response = new Response(); |
|
| 183 |
+ $params1 = array( |
|
| 184 |
+ 'language' => 'en-US' |
|
| 185 |
+ ); |
|
| 186 |
+ |
|
| 187 |
+ $params2 = array( |
|
| 188 |
+ 'volume' => 'loud', |
|
| 189 |
+ 'rate' => 'medium', |
|
| 190 |
+ 'pitchs' => 'high' |
|
| 191 |
+ ); |
|
| 192 |
+ |
|
| 193 |
+ $response->addSpeak('Although in some cases, it might help your audience to ',$params1)
|
|
| 194 |
+ ->addProsody('slow the speaking rate slightly to aid in comprehension.',$params2);
|
|
| 195 |
+ } |
|
| 196 |
+} |
|
| 0 | 197 |
\ No newline at end of file |