|
3 | 3 | class IsJsonTest extends TestCase |
4 | 4 | { |
5 | 5 | /** @test */ |
6 | | - public function it_returns_false_with_null_passed() |
| 6 | + public function it_returns_false_for_null() |
7 | 7 | { |
8 | 8 | $this->assertFalse(is_json(null)); |
9 | 9 | } |
10 | 10 |
|
11 | 11 | /** @test */ |
12 | | - public function it_returns_false_with_boolean_true_passed() |
| 12 | + public function it_returns_false_for_boolean_true() |
13 | 13 | { |
14 | 14 | $this->assertFalse(is_json(true)); |
15 | 15 | } |
16 | 16 |
|
17 | 17 | /** @test */ |
18 | | - public function it_returns_false_with_boolean_false_passed() |
| 18 | + public function it_returns_false_for_boolean_false() |
19 | 19 | { |
20 | 20 | $this->assertFalse(is_json(false)); |
21 | 21 | } |
22 | 22 |
|
23 | 23 | /** @test */ |
24 | | - public function it_returns_false_with_integer_passed() |
| 24 | + public function it_returns_false_for_integer() |
25 | 25 | { |
26 | 26 | $this->assertFalse(is_json(123)); |
27 | 27 | } |
28 | 28 |
|
29 | 29 | /** @test */ |
30 | | - public function it_returns_false_with_float_passed() |
| 30 | + public function it_returns_false_for_float() |
31 | 31 | { |
32 | 32 | $this->assertFalse(is_json(123.45)); |
33 | 33 | } |
34 | 34 |
|
35 | 35 | /** @test */ |
36 | | - public function it_returns_false_with_empty_array_passed() |
| 36 | + public function it_returns_false_for_empty_array() |
37 | 37 | { |
38 | 38 | $this->assertFalse(is_json([])); |
39 | 39 | } |
40 | 40 |
|
41 | 41 | /** @test */ |
42 | | - public function it_returns_false_with_non_empty_array_passed() |
| 42 | + public function it_returns_false_for_non_empty_array() |
43 | 43 | { |
44 | 44 | $this->assertFalse(is_json(['foo' => 'bar'])); |
45 | 45 | } |
46 | 46 |
|
47 | 47 | /** @test */ |
48 | | - public function it_returns_false_with_object_passed() |
| 48 | + public function it_returns_false_for_object() |
49 | 49 | { |
50 | 50 | $this->assertFalse(is_json(new StdClass())); |
51 | 51 | } |
52 | 52 |
|
53 | 53 | /** @test */ |
54 | | - public function it_returns_false_with_an_empty_string_passed() |
| 54 | + public function it_returns_false_for_an_empty_string() |
55 | 55 | { |
56 | 56 | $this->assertFalse(is_json('')); |
57 | 57 | } |
58 | 58 |
|
59 | 59 | /** @test */ |
60 | | - public function it_returns_false_with_non_json_string_passed() |
| 60 | + public function it_returns_false_for_non_json_string() |
61 | 61 | { |
62 | 62 | $this->assertFalse(is_json('non-json string')); |
63 | 63 | } |
64 | 64 |
|
65 | 65 | /** @test */ |
66 | | - public function it_returns_false_with_non_json_string_and_second_argument_passed() |
| 66 | + public function it_returns_false_for_non_json_string_and_second_argument_passed() |
67 | 67 | { |
68 | 68 | $this->assertFalse(is_json('non-json string', true)); |
69 | 69 | } |
70 | 70 |
|
71 | 71 | /** @test */ |
72 | | - public function it_returns_true_with_json_encoded_null_passed() |
| 72 | + public function it_returns_true_for_json_encoded_null() |
73 | 73 | { |
74 | 74 | $json = json_encode(null); |
75 | 75 | $this->assertTrue(is_json($json)); |
76 | 76 | } |
77 | 77 |
|
78 | 78 | /** @test */ |
79 | | - public function it_returns_true_with_json_encoded_boolean_true_passed() |
| 79 | + public function it_returns_true_for_json_encoded_boolean_true() |
80 | 80 | { |
81 | 81 | $json = json_encode(true); |
82 | 82 | $this->assertTrue(is_json($json)); |
83 | 83 | } |
84 | 84 |
|
85 | 85 | /** @test */ |
86 | | - public function it_returns_true_with_json_encoded_boolean_false_passed() |
| 86 | + public function it_returns_true_for_json_encoded_boolean_false() |
87 | 87 | { |
88 | 88 | $json = json_encode(false); |
89 | 89 | $this->assertTrue(is_json($json)); |
90 | 90 | } |
91 | 91 |
|
92 | 92 | /** @test */ |
93 | | - public function it_returns_true_with_json_encoded_integer_passed() |
| 93 | + public function it_returns_true_for_json_encoded_integer() |
94 | 94 | { |
95 | 95 | $json = json_encode(123); |
96 | 96 | $this->assertTrue(is_json($json)); |
97 | 97 | } |
98 | 98 |
|
99 | 99 | /** @test */ |
100 | | - public function it_returns_true_with_json_encoded_float_passed() |
| 100 | + public function it_returns_true_for_json_encoded_float() |
101 | 101 | { |
102 | 102 | $json = json_encode(123.45); |
103 | 103 | $this->assertTrue(is_json($json)); |
104 | 104 | } |
105 | 105 |
|
106 | 106 | /** @test */ |
107 | | - public function it_returns_true_with_json_encoded_array_passed() |
| 107 | + public function it_returns_true_for_json_encoded_array() |
108 | 108 | { |
109 | 109 | $json = json_encode(['foo' => 'bar']); |
110 | 110 | $this->assertTrue(is_json($json)); |
111 | 111 | } |
112 | 112 |
|
113 | 113 | /** @test */ |
114 | | - public function it_returns_true_with_json_encoded_object_passed() |
| 114 | + public function it_returns_true_for_json_encoded_object() |
115 | 115 | { |
116 | 116 | $json = json_encode((object) ['foo' => 'bar', 'baz' => 'bax']); |
117 | 117 | $this->assertTrue(is_json($json)); |
118 | 118 | } |
119 | 119 |
|
120 | 120 | /** @test */ |
121 | | - public function it_returns_true_with_json_encoded_string_passed() |
| 121 | + public function it_returns_true_for_json_encoded_string() |
122 | 122 | { |
123 | 123 | $json = json_encode('string to encode'); |
124 | 124 | $this->assertTrue(is_json($json)); |
|
0 commit comments