@@ -166,21 +166,21 @@ public function testIsValid($value, $isValid)
166166
167167 public function isValidProvider ()
168168 {
169- return array (
169+ return [
170170 /**
171171 * Valid values
172172 */
173- array ( 'foo ' , true ) ,
174- array ( 42 , true ) ,
175- array ( null , true ) ,
176- array ( 0 , true ) ,
177- array ( '' , true ) ,
178- array ( false , true ) ,
173+ [ 'foo ' , true ] ,
174+ [ 42 , true ] ,
175+ [ null , true ] ,
176+ [ 0 , true ] ,
177+ [ '' , true ] ,
178+ [ false , true ] ,
179179 /**
180180 * Invalid values
181181 */
182- array ( 'baz ' , false )
183- ) ;
182+ [ 'baz ' , false ]
183+ ] ;
184184 }
185185
186186 /**
@@ -190,6 +190,7 @@ public function testIsValidKey()
190190 {
191191 $ this ->assertTrue (EnumFixture::isValidKey ('FOO ' ));
192192 $ this ->assertFalse (EnumFixture::isValidKey ('BAZ ' ));
193+ $ this ->assertTrue (EnumFixture::isValidKey ('PROBLEMATIC_NULL ' ));
193194 }
194195
195196 /**
@@ -258,13 +259,13 @@ public function testEqualsConflictValues()
258259 */
259260 public function testJsonSerialize ()
260261 {
261- $ this ->assertJsonStringEqualsJsonString ('"foo" ' , json_encode (new EnumFixture (EnumFixture::FOO )));
262- $ this ->assertJsonStringEqualsJsonString ('"bar" ' , json_encode (new EnumFixture (EnumFixture::BAR )));
263- $ this ->assertJsonStringEqualsJsonString ('42 ' , json_encode (new EnumFixture (EnumFixture::NUMBER )));
264- $ this ->assertJsonStringEqualsJsonString ('0 ' , json_encode (new EnumFixture (EnumFixture::PROBLEMATIC_NUMBER )));
265- $ this ->assertJsonStringEqualsJsonString ('null ' , json_encode (new EnumFixture (EnumFixture::PROBLEMATIC_NULL )));
266- $ this ->assertJsonStringEqualsJsonString ('"" ' , json_encode (new EnumFixture (EnumFixture::PROBLEMATIC_EMPTY_STRING )));
267- $ this ->assertJsonStringEqualsJsonString ('false ' , json_encode (new EnumFixture (EnumFixture::PROBLEMATIC_BOOLEAN_FALSE )));
262+ $ this ->assertJsonEqualsJson ('"foo" ' , json_encode (new EnumFixture (EnumFixture::FOO )));
263+ $ this ->assertJsonEqualsJson ('"bar" ' , json_encode (new EnumFixture (EnumFixture::BAR )));
264+ $ this ->assertJsonEqualsJson ('42 ' , json_encode (new EnumFixture (EnumFixture::NUMBER )));
265+ $ this ->assertJsonEqualsJson ('0 ' , json_encode (new EnumFixture (EnumFixture::PROBLEMATIC_NUMBER )));
266+ $ this ->assertJsonEqualsJson ('null ' , json_encode (new EnumFixture (EnumFixture::PROBLEMATIC_NULL )));
267+ $ this ->assertJsonEqualsJson ('"" ' , json_encode (new EnumFixture (EnumFixture::PROBLEMATIC_EMPTY_STRING )));
268+ $ this ->assertJsonEqualsJson ('false ' , json_encode (new EnumFixture (EnumFixture::PROBLEMATIC_BOOLEAN_FALSE )));
268269 }
269270
270271 public function testNullableEnum ()
@@ -279,4 +280,9 @@ public function testBooleanEnum()
279280 $ this ->assertFalse (EnumFixture::PROBLEMATIC_BOOLEAN_FALSE ()->getValue ());
280281 $ this ->assertFalse ((new EnumFixture (EnumFixture::PROBLEMATIC_BOOLEAN_FALSE ))->jsonSerialize ());
281282 }
283+
284+ private function assertJsonEqualsJson ($ json1 , $ json2 )
285+ {
286+ $ this ->assertJsonStringEqualsJsonString ($ json1 , $ json2 );
287+ }
282288}
0 commit comments