@@ -33,33 +33,33 @@ public function it_returns_false_for_float()
3333 }
3434
3535 /** @test */
36- public function it_returns_false_for_empty_array ()
36+ public function it_returns_false_for_an_empty_string ()
3737 {
38- $ this ->assertFalse (is_json ([] ));
38+ $ this ->assertFalse (is_json ('' ));
3939 }
4040
4141 /** @test */
42- public function it_returns_false_for_non_empty_array ()
42+ public function it_returns_false_for_non_json_string ()
4343 {
44- $ this ->assertFalse (is_json ([ ' foo ' => ' bar ' ] ));
44+ $ this ->assertFalse (is_json (' non-json string ' ));
4545 }
4646
4747 /** @test */
48- public function it_returns_false_for_object ()
48+ public function it_returns_false_for_empty_array ()
4949 {
50- $ this ->assertFalse (is_json (new StdClass () ));
50+ $ this ->assertFalse (is_json ([] ));
5151 }
5252
5353 /** @test */
54- public function it_returns_false_for_an_empty_string ()
54+ public function it_returns_false_for_non_empty_array ()
5555 {
56- $ this ->assertFalse (is_json ('' ));
56+ $ this ->assertFalse (is_json ([ ' foo ' => ' bar ' ] ));
5757 }
5858
5959 /** @test */
60- public function it_returns_false_for_non_json_string ()
60+ public function it_returns_false_for_object ()
6161 {
62- $ this ->assertFalse (is_json (' non-json string ' ));
62+ $ this ->assertFalse (is_json (new StdClass () ));
6363 }
6464
6565 /** @test */
@@ -104,23 +104,23 @@ public function it_returns_true_for_json_encoded_float()
104104 }
105105
106106 /** @test */
107- public function it_returns_true_for_json_encoded_array ()
107+ public function it_returns_true_for_json_encoded_string ()
108108 {
109- $ json = json_encode ([ ' foo ' => ' bar ' ] );
109+ $ json = json_encode (' string to encode ' );
110110 $ this ->assertTrue (is_json ($ json ));
111111 }
112112
113113 /** @test */
114- public function it_returns_true_for_json_encoded_object ()
114+ public function it_returns_true_for_json_encoded_array ()
115115 {
116- $ json = json_encode (( object ) ['foo ' => 'bar ' , ' baz ' => ' bax ' ]);
116+ $ json = json_encode (['foo ' => 'bar ' ]);
117117 $ this ->assertTrue (is_json ($ json ));
118118 }
119119
120120 /** @test */
121- public function it_returns_true_for_json_encoded_string ()
121+ public function it_returns_true_for_json_encoded_object ()
122122 {
123- $ json = json_encode (' string to encode ' );
123+ $ json = json_encode (( object ) [ ' foo ' => ' bar ' , ' baz ' => ' bax ' ] );
124124 $ this ->assertTrue (is_json ($ json ));
125125 }
126126
0 commit comments