@@ -124,22 +124,33 @@ public function testParsingInvalidResponseFails()
124124 $ parser ->push ("invalid response \r\n\r\n" );
125125 }
126126
127- /**
128- * @expectedException UnexpectedValueException
129- */
130- public function testParsingInvalidResponseNoSpaceAfterColonFails ()
127+ public function testParsingMissingSpaceWithValue ()
131128 {
132129 $ parser = new Parser ();
133130 $ this ->assertEquals (array (), $ parser ->push ("Asterisk Call Manager/1.3 \r\n" ));
134131
135- $ parser ->push ("Response:NoSpace \r\n\r\n" );
132+ $ ret = $ parser ->push ("Response:NoSpace \r\n\r\n" );
133+ $ this ->assertCount (1 , $ ret );
134+
135+ $ first = reset ($ ret );
136+ /* @var $first Clue\React\Ami\Protocol\Response */
137+
138+ $ this ->assertInstanceOf ('Clue\React\Ami\Protocol\Response ' , $ first );
139+ $ this ->assertEquals ('NoSpace ' , $ first ->getFieldValue ('Response ' ));
136140 }
137141
138- public function testParsingEmptyValue ()
142+ public function testParsingMissingSpaceEmptyValue ()
139143 {
140144 $ parser = new Parser ();
141145 $ this ->assertEquals (array (), $ parser ->push ("Asterisk Call Manager/1.3 \r\n" ));
142146
143- $ parser ->push ("Response: \r\n\r\n" );
147+ $ ret = $ parser ->push ("Response: \r\n\r\n" );
148+ $ this ->assertCount (1 , $ ret );
149+
150+ $ first = reset ($ ret );
151+ /* @var $first Clue\React\Ami\Protocol\Response */
152+
153+ $ this ->assertInstanceOf ('Clue\React\Ami\Protocol\Response ' , $ first );
154+ $ this ->assertEquals ('' , $ first ->getFieldValue ('Response ' ));
144155 }
145156}
0 commit comments