Browse code

added appinfo/info.xml appinfo/signature.json CHANGELOG.txt lib/AppInfo/Application.php css/style.css providers/Plivo

DoubleBastionAdmin authored on 05/11/2025 13:35:09
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,90 @@
1
+<?php
2
+namespace XML;
3
+
4
+use Plivo\XML\Response;
5
+use Plivo\Tests\BaseTestCase;
6
+
7
+/**
8
+ * Class SubTest
9
+ * @package Plivo\Tests\XML
10
+ */
11
+class SubTest extends BaseTestCase 
12
+{
13
+    
14
+    function testAddSub()
15
+    {
16
+        $response = new Response();
17
+        $params1 = array(
18
+            'language' => 'en-US',
19
+            'voice' => 'Polly.Joanna'  
20
+        );
21
+
22
+        $params2 = array(
23
+            'alias' => 'Mercury'
24
+        );
25
+
26
+        $response->addSpeak('My favorite chemical element is ',$params1)
27
+            ->addSub('Hg',$params2)
28
+            ->continueSpeak(', because it looks so shiny.');
29
+        $ssml = $response->toXML(true);
30
+        // $actual = new \DOMDocument;
31
+        // $actual->loadXML($ssml);
32
+
33
+        self::assertNotNull($ssml);
34
+
35
+        self::assertXmlStringEqualsXmlFile(__DIR__ . '/../Mocks/subSpeak.xml',$ssml);
36
+    }
37
+
38
+    function testExceptionAddSub()
39
+    {
40
+        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
41
+        $response = new Response();
42
+        $params1 = array(
43
+            'language' => 'en-US',
44
+            'voice' => 'Polly.Joanna'  
45
+        );
46
+
47
+        $params2 = array(
48
+            'alia' => 'Mercury'
49
+        );
50
+
51
+        $response->addSpeak('My favorite chemical element is ',$params1)
52
+            ->addSub('',$params2)
53
+            ->continueSpeak(', because it looks so shiny.');
54
+        $ssml = $response->toXML(true);
55
+    }
56
+
57
+    function testExceptionAttributeAliasAddSub()
58
+    {
59
+        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
60
+        $response = new Response();
61
+        $params1 = array(
62
+            'language' => 'en-US',
63
+            'voice' => 'Polly.Joanna'  
64
+        );
65
+
66
+        $params2 = array(
67
+            'alia' => 'Mercury'
68
+        );
69
+
70
+        $response->addSpeak('My favorite chemical element is ',$params1)
71
+            ->addSub('Hg',$params2)
72
+            ->continueSpeak(', because it looks so shiny.');
73
+        $ssml = $response->toXML(true);
74
+    }
75
+
76
+    function testExceptionSSMLSupported()
77
+    {
78
+        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
79
+        $response = new Response();
80
+        $params1 = array(
81
+            'language' => 'en-US' 
82
+        );
83
+        $params2 = array(
84
+            'alias' => 'Mercury'
85
+        );
86
+        $response->addSpeak('My favorite chemical element is ',$params1)
87
+            ->addSub('Hg',$params2)
88
+            ->continueSpeak(', because it looks so shiny.');
89
+    }
90
+}
0 91
\ No newline at end of file
Browse code

removed appinfo/info.xml appinfo/signature.json CHANGELOG.txt lib/AppInfo/Application.php css/style.css providers/Plivo

DoubleBastionAdmin authored on 05/11/2025 13:12:22
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,90 +0,0 @@
1
-<?php
2
-namespace XML;
3
-
4
-use Plivo\XML\Response;
5
-use Plivo\Tests\BaseTestCase;
6
-
7
-/**
8
- * Class SubTest
9
- * @package Plivo\Tests\XML
10
- */
11
-class SubTest extends BaseTestCase 
12
-{
13
-    
14
-    function testAddSub()
15
-    {
16
-        $response = new Response();
17
-        $params1 = array(
18
-            'language' => 'en-US',
19
-            'voice' => 'Polly.Joanna'  
20
-        );
21
-
22
-        $params2 = array(
23
-            'alias' => 'Mercury'
24
-        );
25
-
26
-        $response->addSpeak('My favorite chemical element is ',$params1)
27
-            ->addSub('Hg',$params2)
28
-            ->continueSpeak(', because it looks so shiny.');
29
-        $ssml = $response->toXML(true);
30
-        // $actual = new \DOMDocument;
31
-        // $actual->loadXML($ssml);
32
-
33
-        self::assertNotNull($ssml);
34
-
35
-        self::assertXmlStringEqualsXmlFile(__DIR__ . '/../Mocks/subSpeak.xml',$ssml);
36
-    }
37
-
38
-    function testExceptionAddSub()
39
-    {
40
-        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
41
-        $response = new Response();
42
-        $params1 = array(
43
-            'language' => 'en-US',
44
-            'voice' => 'Polly.Joanna'  
45
-        );
46
-
47
-        $params2 = array(
48
-            'alia' => 'Mercury'
49
-        );
50
-
51
-        $response->addSpeak('My favorite chemical element is ',$params1)
52
-            ->addSub('',$params2)
53
-            ->continueSpeak(', because it looks so shiny.');
54
-        $ssml = $response->toXML(true);
55
-    }
56
-
57
-    function testExceptionAttributeAliasAddSub()
58
-    {
59
-        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
60
-        $response = new Response();
61
-        $params1 = array(
62
-            'language' => 'en-US',
63
-            'voice' => 'Polly.Joanna'  
64
-        );
65
-
66
-        $params2 = array(
67
-            'alia' => 'Mercury'
68
-        );
69
-
70
-        $response->addSpeak('My favorite chemical element is ',$params1)
71
-            ->addSub('Hg',$params2)
72
-            ->continueSpeak(', because it looks so shiny.');
73
-        $ssml = $response->toXML(true);
74
-    }
75
-
76
-    function testExceptionSSMLSupported()
77
-    {
78
-        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
79
-        $response = new Response();
80
-        $params1 = array(
81
-            'language' => 'en-US' 
82
-        );
83
-        $params2 = array(
84
-            'alias' => 'Mercury'
85
-        );
86
-        $response->addSpeak('My favorite chemical element is ',$params1)
87
-            ->addSub('Hg',$params2)
88
-            ->continueSpeak(', because it looks so shiny.');
89
-    }
90
-}
91 0
\ No newline at end of file
Browse code

Added README.md appinfo/info.xml appinfo/signature.json lib/Controller/AuthorApiController.php and the providers directory

DoubleBastionAdmin authored on 20/08/2022 16:33:00
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,90 @@
1
+<?php
2
+namespace XML;
3
+
4
+use Plivo\XML\Response;
5
+use Plivo\Tests\BaseTestCase;
6
+
7
+/**
8
+ * Class SubTest
9
+ * @package Plivo\Tests\XML
10
+ */
11
+class SubTest extends BaseTestCase 
12
+{
13
+    
14
+    function testAddSub()
15
+    {
16
+        $response = new Response();
17
+        $params1 = array(
18
+            'language' => 'en-US',
19
+            'voice' => 'Polly.Joanna'  
20
+        );
21
+
22
+        $params2 = array(
23
+            'alias' => 'Mercury'
24
+        );
25
+
26
+        $response->addSpeak('My favorite chemical element is ',$params1)
27
+            ->addSub('Hg',$params2)
28
+            ->continueSpeak(', because it looks so shiny.');
29
+        $ssml = $response->toXML(true);
30
+        // $actual = new \DOMDocument;
31
+        // $actual->loadXML($ssml);
32
+
33
+        self::assertNotNull($ssml);
34
+
35
+        self::assertXmlStringEqualsXmlFile(__DIR__ . '/../Mocks/subSpeak.xml',$ssml);
36
+    }
37
+
38
+    function testExceptionAddSub()
39
+    {
40
+        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
41
+        $response = new Response();
42
+        $params1 = array(
43
+            'language' => 'en-US',
44
+            'voice' => 'Polly.Joanna'  
45
+        );
46
+
47
+        $params2 = array(
48
+            'alia' => 'Mercury'
49
+        );
50
+
51
+        $response->addSpeak('My favorite chemical element is ',$params1)
52
+            ->addSub('',$params2)
53
+            ->continueSpeak(', because it looks so shiny.');
54
+        $ssml = $response->toXML(true);
55
+    }
56
+
57
+    function testExceptionAttributeAliasAddSub()
58
+    {
59
+        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
60
+        $response = new Response();
61
+        $params1 = array(
62
+            'language' => 'en-US',
63
+            'voice' => 'Polly.Joanna'  
64
+        );
65
+
66
+        $params2 = array(
67
+            'alia' => 'Mercury'
68
+        );
69
+
70
+        $response->addSpeak('My favorite chemical element is ',$params1)
71
+            ->addSub('Hg',$params2)
72
+            ->continueSpeak(', because it looks so shiny.');
73
+        $ssml = $response->toXML(true);
74
+    }
75
+
76
+    function testExceptionSSMLSupported()
77
+    {
78
+        $this->expectPlivoException('Plivo\Exceptions\PlivoXMLException');
79
+        $response = new Response();
80
+        $params1 = array(
81
+            'language' => 'en-US' 
82
+        );
83
+        $params2 = array(
84
+            'alias' => 'Mercury'
85
+        );
86
+        $response->addSpeak('My favorite chemical element is ',$params1)
87
+            ->addSub('Hg',$params2)
88
+            ->continueSpeak(', because it looks so shiny.');
89
+    }
90
+}
0 91
\ No newline at end of file