@@ -28,6 +28,12 @@ public function testOneFieldValue()
2828 $ action = new Action (array ('Action ' => 'name ' ));
2929
3030 $ this ->assertEquals ("Action: name \r\n\r\n" , $ action ->getMessageSerialized ());
31+
32+ $ this ->assertEquals ('name ' , $ action ->getFieldValue ('Action ' ));
33+ $ this ->assertEquals (array ('name ' ), $ action ->getFieldValues ('Action ' ));
34+
35+ $ this ->assertEquals (null , $ action ->getFieldValue ('unknown ' ));
36+ $ this ->assertEquals (array (), $ action ->getFieldValues ('unknown ' ));
3137 }
3238
3339 public function testMultipleFieldsSingleValue ()
@@ -44,6 +50,7 @@ public function testOneFieldNoValue()
4450 $ this ->assertEquals ("\r\n" , $ action ->getMessageSerialized ());
4551
4652 $ this ->assertNull ($ action ->getFieldValue ('Key ' ));
53+ $ this ->assertEquals (array (), $ action ->getFieldValues ('Key ' ));
4754 }
4855
4956 public function testOneFieldNoValues ()
@@ -53,13 +60,17 @@ public function testOneFieldNoValues()
5360 $ this ->assertEquals ("\r\n" , $ action ->getMessageSerialized ());
5461
5562 $ this ->assertNull ($ action ->getFieldValue ('Key ' ));
63+ $ this ->assertEquals (array (), $ action ->getFieldValues ('Key ' ));
5664 }
5765
5866 public function testOneFieldMultipleValues ()
5967 {
6068 $ action = new Action (array ('Key ' => array ('Value1 ' , 'Value2 ' )));
6169
6270 $ this ->assertEquals ("Key: Value1 \r\nKey: Value2 \r\n\r\n" , $ action ->getMessageSerialized ());
71+
72+ $ this ->assertEquals ('Value1 ' , $ action ->getFieldValue ('Key ' ));
73+ $ this ->assertEquals (array ('Value1 ' , 'Value2 ' ), $ action ->getFieldValues ('Key ' ));
6374 }
6475
6576 public function testOneFieldMultipleValuesIgnoreNulls ()
@@ -69,6 +80,7 @@ public function testOneFieldMultipleValuesIgnoreNulls()
6980 $ this ->assertEquals ("Key: value \r\n\r\n" , $ action ->getMessageSerialized ());
7081
7182 $ this ->assertEquals ('value ' , $ action ->getFieldValue ('Key ' ));
83+ $ this ->assertEquals (array ('value ' ), $ action ->getFieldValues ('Key ' ));
7284 }
7385
7486 public function testOneFieldMultipleKeyValues ()
@@ -78,5 +90,6 @@ public function testOneFieldMultipleKeyValues()
7890 $ this ->assertEquals ("Variables: first=on \r\nVariables: second=off \r\n\r\n" , $ action ->getMessageSerialized ());
7991
8092 $ this ->assertEquals ('first=on ' , $ action ->getFieldValue ('Variables ' ));
93+ $ this ->assertEquals (array ('first=on ' , 'second=off ' ), $ action ->getFieldValues ('Variables ' ));
8194 }
8295}
0 commit comments