@@ -97,39 +97,45 @@ public function testSupportsKeyBasedAccess()
9797 /**
9898 * @dataProvider scalarTypes
9999 */
100- public function testScalarKeys ($ keyType , $ keyValue , $ keyValueCopy )
100+ public function testScalarKeys ($ keyType , $ values )
101101 {
102102 $ map = Type::map ($ keyType , Type::varchar ())->create ();
103- $ map ->set ($ keyValue , "value " );
104- $ this ->assertEquals (1 , count ($ map ));
105- $ this ->assertEquals ($ map ->get ($ keyValue ), "value " );
106- $ this ->assertEquals ($ map ->get ($ keyValueCopy ), "value " );
107- $ this ->assertTrue ($ map ->has ($ keyValue ));
108- $ this ->assertTrue ($ map ->has ($ keyValueCopy ));
109- $ map ->remove ($ keyValue );
103+ foreach ($ values as $ index => $ keyValue ) {
104+ $ map ->set ($ keyValue , "value $ index " );
105+ }
106+ $ this ->assertEquals (count ($ values ), count ($ map ));
107+
108+ foreach ($ values as $ index => $ keyValue ) {
109+ $ this ->assertTrue ($ map ->has ($ keyValue ));
110+ $ this ->assertEquals ($ map ->get ($ keyValue ), "value $ index " );
111+ }
112+
113+ foreach ($ values as $ keyValue ) {
114+ $ map ->remove ($ keyValue );
115+ }
110116 $ this ->assertEquals (0 , count ($ map ));
111117 }
112118
113119 public function scalarTypes ()
114120 {
115121 return array (
116- array (Type::ascii (), "ascii " , " ascii " ),
117- array (Type::bigint (), new Bigint ( " 9223372036854775807 " ), new Bigint ("9223372036854775807 " )),
118- array (Type::blob (), new Blob ( " blob " ), new Blob ("blob " )),
119- array (Type::boolean (), true , true ),
120- array (Type::counter (), new Bigint ( 123 ), new Bigint (123 )),
121- array (Type::decimal (), new Decimal ( " 3.14159265359 " ), new Decimal ("3.14159265359 " )),
122- array (Type::double (), 3.14159 , 3.14159 ),
123- array (Type::float (), new Float ( 3.14159 ), new Float (3.14159 )),
124- array (Type::inet (), new Inet ( " 127.0.0.1 " ), new Inet ("127.0.0.1 " )),
125- array (Type::int (), 123 , 123 ),
126- array (Type::text (), "text " , " text " ),
127- array (Type::timestamp (), new Timestamp ( 123 ), new Timestamp (123 )),
128- array (Type::timeuuid (), new Timeuuid ( 0 ), new Timeuuid (0 )),
129- array (Type::uuid (), new Uuid ( " 03398c99-c635-4fad-b30a-3b2c49f785c2 " ), new Uuid ("03398c99-c635-4fad-b30a-3b2c49f785c2 " )),
130- array (Type::varchar (), "varchar " , " varchar " ),
131- array (Type::varint (), new Varint ( " 9223372036854775808 " ), new Varint ("9223372036854775808 " )),
132- array (Type::duration (), new Duration ( 1 , 2 , 3 ), new Duration (1 , 2 , 3 ))
122+ array (Type::ascii (), array ( "ascii " ) ),
123+ array (Type::bigint (), array ( new Bigint ("9223372036854775807 " ) )),
124+ array (Type::blob (), array ( new Blob ("blob " ) )),
125+ array (Type::boolean (), array ( true , false ) ),
126+ array (Type::counter (), array ( new Bigint (123 ) )),
127+ array (Type::decimal (), array ( new Decimal ("3.14159265359 " ) )),
128+ array (Type::double (), array ( 3.14159 ) ),
129+ array (Type::float (), array ( new Float (3.14159 ) )),
130+ array (Type::inet (), array ( new Inet ("127.0.0.1 " ) )),
131+ array (Type::int (), array ( 123 ) ),
132+ array (Type::text (), array ( "text " ) ),
133+ array (Type::timestamp (), array ( new Timestamp (123 ) )),
134+ array (Type::timeuuid (), array ( new Timeuuid (0 ) )),
135+ array (Type::uuid (), array ( new Uuid ("03398c99-c635-4fad-b30a-3b2c49f785c2 " ) )),
136+ array (Type::varchar (), array ( "varchar " ) ),
137+ array (Type::varint (), array ( new Varint ("9223372036854775808 " ) )),
138+ array (Type::duration (), array ( new Duration (1 , 2 , 3 ) ))
133139 );
134140 }
135141
0 commit comments