@@ -97,7 +97,7 @@ public function testCreate()
97
97
{
98
98
$ response = JsonResponse::create (['foo ' => 'bar ' ], 204 );
99
99
100
- $ this ->assertInstanceOf (' Symfony\Component\HttpFoundation\ JsonResponse' , $ response );
100
+ $ this ->assertInstanceOf (JsonResponse::class , $ response );
101
101
$ this ->assertEquals ('{"foo":"bar"} ' , $ response ->getContent ());
102
102
$ this ->assertEquals (204 , $ response ->getStatusCode ());
103
103
}
@@ -108,7 +108,7 @@ public function testCreate()
108
108
public function testStaticCreateEmptyJsonObject ()
109
109
{
110
110
$ response = JsonResponse::create ();
111
- $ this ->assertInstanceOf (' Symfony\Component\HttpFoundation\ JsonResponse' , $ response );
111
+ $ this ->assertInstanceOf (JsonResponse::class , $ response );
112
112
$ this ->assertSame ('{} ' , $ response ->getContent ());
113
113
}
114
114
@@ -118,7 +118,7 @@ public function testStaticCreateEmptyJsonObject()
118
118
public function testStaticCreateJsonArray ()
119
119
{
120
120
$ response = JsonResponse::create ([0 , 1 , 2 , 3 ]);
121
- $ this ->assertInstanceOf (' Symfony\Component\HttpFoundation\ JsonResponse' , $ response );
121
+ $ this ->assertInstanceOf (JsonResponse::class , $ response );
122
122
$ this ->assertSame ('[0,1,2,3] ' , $ response ->getContent ());
123
123
}
124
124
@@ -128,7 +128,7 @@ public function testStaticCreateJsonArray()
128
128
public function testStaticCreateJsonObject ()
129
129
{
130
130
$ response = JsonResponse::create (['foo ' => 'bar ' ]);
131
- $ this ->assertInstanceOf (' Symfony\Component\HttpFoundation\ JsonResponse' , $ response );
131
+ $ this ->assertInstanceOf (JsonResponse::class , $ response );
132
132
$ this ->assertSame ('{"foo":"bar"} ' , $ response ->getContent ());
133
133
}
134
134
@@ -138,20 +138,20 @@ public function testStaticCreateJsonObject()
138
138
public function testStaticCreateWithSimpleTypes ()
139
139
{
140
140
$ response = JsonResponse::create ('foo ' );
141
- $ this ->assertInstanceOf (' Symfony\Component\HttpFoundation\ JsonResponse' , $ response );
141
+ $ this ->assertInstanceOf (JsonResponse::class , $ response );
142
142
$ this ->assertSame ('"foo" ' , $ response ->getContent ());
143
143
144
144
$ response = JsonResponse::create (0 );
145
- $ this ->assertInstanceOf (' Symfony\Component\HttpFoundation\ JsonResponse' , $ response );
145
+ $ this ->assertInstanceOf (JsonResponse::class , $ response );
146
146
$ this ->assertSame ('0 ' , $ response ->getContent ());
147
147
148
148
$ response = JsonResponse::create (0.1 );
149
- $ this ->assertInstanceOf (' Symfony\Component\HttpFoundation\ JsonResponse' , $ response );
149
+ $ this ->assertInstanceOf (JsonResponse::class , $ response );
150
150
$ this ->assertEquals (0.1 , $ response ->getContent ());
151
151
$ this ->assertIsString ($ response ->getContent ());
152
152
153
153
$ response = JsonResponse::create (true );
154
- $ this ->assertInstanceOf (' Symfony\Component\HttpFoundation\ JsonResponse' , $ response );
154
+ $ this ->assertInstanceOf (JsonResponse::class , $ response );
155
155
$ this ->assertSame ('true ' , $ response ->getContent ());
156
156
}
157
157
@@ -236,22 +236,22 @@ public function testItAcceptsJsonAsString()
236
236
237
237
public function testSetCallbackInvalidIdentifier ()
238
238
{
239
- $ this ->expectException (' InvalidArgumentException ' );
239
+ $ this ->expectException (\ InvalidArgumentException::class );
240
240
$ response = new JsonResponse ('foo ' );
241
241
$ response ->setCallback ('+invalid ' );
242
242
}
243
243
244
244
public function testSetContent ()
245
245
{
246
- $ this ->expectException (' InvalidArgumentException ' );
246
+ $ this ->expectException (\ InvalidArgumentException::class );
247
247
new JsonResponse ("\xB1\x31" );
248
248
}
249
249
250
250
public function testSetContentJsonSerializeError ()
251
251
{
252
- $ this ->expectException (' Exception ' );
252
+ $ this ->expectException (\ Exception::class );
253
253
$ this ->expectExceptionMessage ('This error is expected ' );
254
- if (!interface_exists (' JsonSerializable ' , false )) {
254
+ if (!interface_exists (\ JsonSerializable::class , false )) {
255
255
$ this ->markTestSkipped ('JsonSerializable is required. ' );
256
256
}
257
257
@@ -299,7 +299,7 @@ public function testConstructorWithObjectWithoutToStringMethodThrowsAnException(
299
299
}
300
300
}
301
301
302
- if (interface_exists (' JsonSerializable ' , false )) {
302
+ if (interface_exists (\ JsonSerializable::class , false )) {
303
303
class JsonSerializableObject implements \JsonSerializable
304
304
{
305
305
public function jsonSerialize ()
0 commit comments