Browse code

removed Telnyx Plivo Twilio Flowroute appinfo/info.xml appinfo/signature.json README.md lib/Controller/AuthorApiController.php

DoubleBastionAdmin authored on 20/08/2022 16:26:33
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,145 +0,0 @@
1
-<?php
2
-namespace XML;
3
-
4
-use Plivo\XML\Response;
5
-use Plivo\Tests\BaseTestCase;
6
-
7
-/**
8
- * Class PhonemeTest
9
- * @package Plivo\Tests\XML
10
- */
11
-class PhonemeTest extends BaseTestCase 
12
-{
13
-    
14
-    function testAddPhoneme()
15
-    {
16
-        $response = new Response();
17
-        $params1 = array(
18
-            'language' => 'en-US',
19
-            'voice' => 'Polly.Joanna'  
20
-        );
21
-
22
-        $params2 = array(
23
-            'alphabet' => 'ipa',
24
-            'ph' => "pɪˈkɑːn"
25
-        );
26
-
27
-        $response->addSpeak('You say, ',$params1)
28
-            ->addPhoneme('pecan',$params2)
29
-            ->continueSpeak('.')
30
-            ->continueSpeak('I say, ')
31
-            ->addPhoneme('pecan',array(
32
-                'alphabet' => 'ipa',
33
-                'ph' => "ˈpi.kæn"
34
-            ))
35
-            ->continueSpeak('.');
36
-        $ssml = $response->toXML(true);
37
-        // $actual = new \DOMDocument;
38
-        // $actual->loadXML($ssml);
39
-
40
-        self::assertNotNull($ssml);
41
-
42
-        self::assertXmlStringEqualsXmlFile(__DIR__ . '/../Mocks/phonemeSpeak.xml',$ssml);
43
-    }
44
-
45
-    function testExceptionAddPhoneme()
46
-    {
47
-        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
48
-        $response = new Response();
49
-        $params1 = array(
50
-            'language' => 'en-US',
51
-            'voice' => 'Polly.Joanna'  
52
-        );
53
-
54
-        $params2 = array(
55
-            'alphabet' => 'ipa',
56
-            'ph' => "pɪˈkɑːn"
57
-        );
58
-
59
-        $response->addSpeak('You say, ',$params1)
60
-            ->addPhoneme('pecan',$params2)
61
-            ->continueSpeak('.')
62
-            ->continueSpeak('I say, ')
63
-            ->addPhoneme('',array(
64
-                'alphabet' => 'ipa',
65
-                'ph' => "ˈpi.kæn"
66
-            ))
67
-            ->continueSpeak('.');
68
-        $ssml = $response->toXML(true);
69
-    }
70
-
71
-    function testExceptionAttributeAlphabetAddPhoneme()
72
-    {
73
-        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
74
-        $response = new Response();
75
-        $params1 = array(
76
-            'language' => 'en-US',
77
-            'voice' => 'Polly.Joanna'  
78
-        );
79
-
80
-        $params2 = array(
81
-            'alphabet' => 'ipa',
82
-            'ph' => "pɪˈkɑːn"
83
-        );
84
-
85
-        $response->addSpeak('You say, ',$params1)
86
-            ->addPhoneme('pecan',$params2)
87
-            ->continueSpeak('.')
88
-            ->continueSpeak('I say, ')
89
-            ->addPhoneme('pecan',array(
90
-                'alphabets' => 'ipa',
91
-                'ph' => "ˈpi.kæn"
92
-            ))
93
-            ->continueSpeak('.');
94
-        $ssml = $response->toXML(true);
95
-    }
96
-
97
-    function testExceptionAttributeAlphabetValueAddPhoneme()
98
-    {
99
-        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
100
-        $response = new Response();
101
-        $params1 = array(
102
-            'language' => 'en-US',
103
-            'voice' => 'Polly.Joanna'  
104
-        );
105
-
106
-        $params2 = array(
107
-            'alphabet' => 'ipa',
108
-            'ph' => "pɪˈkɑːn"
109
-        );
110
-
111
-        $response->addSpeak('You say, ',$params1)
112
-            ->addPhoneme('pecan',$params2)
113
-            ->continueSpeak('.')
114
-            ->continueSpeak('I say, ')
115
-            ->addPhoneme('pecan',array(
116
-                'alphabet' => 'ip',
117
-                'ph' => "ˈpi.kæn"
118
-            ))
119
-            ->continueSpeak('.');
120
-        $ssml = $response->toXML(true);
121
-    }
122
-
123
-    function testExceptionSSMLSupported()
124
-    {
125
-        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
126
-        $params1 = array(
127
-            'language' => 'en-US' 
128
-        );
129
-        $params2 = array(
130
-            'strength' => 'x-weak',
131
-            'times' => '3s'  
132
-        );
133
-        $response = new Response();
134
-        $response->addSpeak('You say, ',$params1)
135
-            ->addPhoneme('pecan',$params2)
136
-            ->continueSpeak('.')
137
-            ->continueSpeak('I say, ')
138
-            ->addPhoneme('pecan',array(
139
-                'alphabet' => 'ipa',
140
-                'ph' => "ˈpi.kæn"
141
-            ))
142
-            ->continueSpeak('.');
143
-    }
144
-
145
-}
146 0
\ No newline at end of file
Browse code

Created repository.

DoubleBastionAdmin authored on 01/03/2022 23:47:00
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,145 @@
1
+<?php
2
+namespace XML;
3
+
4
+use Plivo\XML\Response;
5
+use Plivo\Tests\BaseTestCase;
6
+
7
+/**
8
+ * Class PhonemeTest
9
+ * @package Plivo\Tests\XML
10
+ */
11
+class PhonemeTest extends BaseTestCase 
12
+{
13
+    
14
+    function testAddPhoneme()
15
+    {
16
+        $response = new Response();
17
+        $params1 = array(
18
+            'language' => 'en-US',
19
+            'voice' => 'Polly.Joanna'  
20
+        );
21
+
22
+        $params2 = array(
23
+            'alphabet' => 'ipa',
24
+            'ph' => "pɪˈkɑːn"
25
+        );
26
+
27
+        $response->addSpeak('You say, ',$params1)
28
+            ->addPhoneme('pecan',$params2)
29
+            ->continueSpeak('.')
30
+            ->continueSpeak('I say, ')
31
+            ->addPhoneme('pecan',array(
32
+                'alphabet' => 'ipa',
33
+                'ph' => "ˈpi.kæn"
34
+            ))
35
+            ->continueSpeak('.');
36
+        $ssml = $response->toXML(true);
37
+        // $actual = new \DOMDocument;
38
+        // $actual->loadXML($ssml);
39
+
40
+        self::assertNotNull($ssml);
41
+
42
+        self::assertXmlStringEqualsXmlFile(__DIR__ . '/../Mocks/phonemeSpeak.xml',$ssml);
43
+    }
44
+
45
+    function testExceptionAddPhoneme()
46
+    {
47
+        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
48
+        $response = new Response();
49
+        $params1 = array(
50
+            'language' => 'en-US',
51
+            'voice' => 'Polly.Joanna'  
52
+        );
53
+
54
+        $params2 = array(
55
+            'alphabet' => 'ipa',
56
+            'ph' => "pɪˈkɑːn"
57
+        );
58
+
59
+        $response->addSpeak('You say, ',$params1)
60
+            ->addPhoneme('pecan',$params2)
61
+            ->continueSpeak('.')
62
+            ->continueSpeak('I say, ')
63
+            ->addPhoneme('',array(
64
+                'alphabet' => 'ipa',
65
+                'ph' => "ˈpi.kæn"
66
+            ))
67
+            ->continueSpeak('.');
68
+        $ssml = $response->toXML(true);
69
+    }
70
+
71
+    function testExceptionAttributeAlphabetAddPhoneme()
72
+    {
73
+        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
74
+        $response = new Response();
75
+        $params1 = array(
76
+            'language' => 'en-US',
77
+            'voice' => 'Polly.Joanna'  
78
+        );
79
+
80
+        $params2 = array(
81
+            'alphabet' => 'ipa',
82
+            'ph' => "pɪˈkɑːn"
83
+        );
84
+
85
+        $response->addSpeak('You say, ',$params1)
86
+            ->addPhoneme('pecan',$params2)
87
+            ->continueSpeak('.')
88
+            ->continueSpeak('I say, ')
89
+            ->addPhoneme('pecan',array(
90
+                'alphabets' => 'ipa',
91
+                'ph' => "ˈpi.kæn"
92
+            ))
93
+            ->continueSpeak('.');
94
+        $ssml = $response->toXML(true);
95
+    }
96
+
97
+    function testExceptionAttributeAlphabetValueAddPhoneme()
98
+    {
99
+        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
100
+        $response = new Response();
101
+        $params1 = array(
102
+            'language' => 'en-US',
103
+            'voice' => 'Polly.Joanna'  
104
+        );
105
+
106
+        $params2 = array(
107
+            'alphabet' => 'ipa',
108
+            'ph' => "pɪˈkɑːn"
109
+        );
110
+
111
+        $response->addSpeak('You say, ',$params1)
112
+            ->addPhoneme('pecan',$params2)
113
+            ->continueSpeak('.')
114
+            ->continueSpeak('I say, ')
115
+            ->addPhoneme('pecan',array(
116
+                'alphabet' => 'ip',
117
+                'ph' => "ˈpi.kæn"
118
+            ))
119
+            ->continueSpeak('.');
120
+        $ssml = $response->toXML(true);
121
+    }
122
+
123
+    function testExceptionSSMLSupported()
124
+    {
125
+        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
126
+        $params1 = array(
127
+            'language' => 'en-US' 
128
+        );
129
+        $params2 = array(
130
+            'strength' => 'x-weak',
131
+            'times' => '3s'  
132
+        );
133
+        $response = new Response();
134
+        $response->addSpeak('You say, ',$params1)
135
+            ->addPhoneme('pecan',$params2)
136
+            ->continueSpeak('.')
137
+            ->continueSpeak('I say, ')
138
+            ->addPhoneme('pecan',array(
139
+                'alphabet' => 'ipa',
140
+                'ph' => "ˈpi.kæn"
141
+            ))
142
+            ->continueSpeak('.');
143
+    }
144
+
145
+}
0 146
\ No newline at end of file