@@ -68,7 +68,23 @@ public function testParseResponseMultipleValues()
6868 $ this ->assertEquals (array ('one ' , 'two ' ), $ first ->getFieldValues ('Message ' ));
6969 }
7070
71- public function testParsingCommandResponse ()
71+ public function testParsingAsterisk14CommandResponse ()
72+ {
73+ $ parser = new Parser ();
74+ $ this ->assertEquals (array (), $ parser ->push ("Asterisk Call Manager/1.3 \r\n" ));
75+
76+ $ ret = $ parser ->push ("Response: Follows \r\nOutput: Testing: yes \r\nOutput: Another Line \r\n\r\n" );
77+ $ this ->assertCount (1 , $ ret );
78+
79+ $ first = reset ($ ret );
80+ /* @var $first \Clue\React\Ami\Protocol\Response */
81+
82+ $ this ->assertInstanceOf ('Clue\React\Ami\Protocol\Response ' , $ first );
83+ $ this ->assertEquals ('Follows ' , $ first ->getFieldValue ('Response ' ));
84+ $ this ->assertEquals ("Testing: yes \nAnother Line " , $ first ->getCommandOutput ());
85+ }
86+
87+ public function testParsingLegacyCommandResponse ()
7288 {
7389 $ parser = new Parser ();
7490 $ this ->assertEquals (array (), $ parser ->push ("Asterisk Call Manager/1.3 \r\n" ));
@@ -84,7 +100,7 @@ public function testParsingCommandResponse()
84100 $ this ->assertEquals ("Testing: yes \nAnother Line \n--END COMMAND-- " , $ first ->getCommandOutput ());
85101 }
86102
87- public function testParsingCommandResponseEmpty ()
103+ public function testParsingLegacyCommandResponseEmpty ()
88104 {
89105 $ parser = new Parser ();
90106 $ this ->assertEquals (array (), $ parser ->push ("Asterisk Call Manager/1.3 \r\n" ));
0 commit comments