@@ -90,6 +90,9 @@ public function testSetJson()
9090 $ this ->assertEquals ('true ' , $ response ->getContent ());
9191 }
9292
93+ /**
94+ * @group legacy
95+ */
9396 public function testCreate ()
9497 {
9598 $ response = JsonResponse::create (['foo ' => 'bar ' ], 204 );
@@ -99,27 +102,39 @@ public function testCreate()
99102 $ this ->assertEquals (204 , $ response ->getStatusCode ());
100103 }
101104
105+ /**
106+ * @group legacy
107+ */
102108 public function testStaticCreateEmptyJsonObject ()
103109 {
104110 $ response = JsonResponse::create ();
105111 $ this ->assertInstanceOf ('Symfony\Component\HttpFoundation\JsonResponse ' , $ response );
106112 $ this ->assertSame ('{} ' , $ response ->getContent ());
107113 }
108114
115+ /**
116+ * @group legacy
117+ */
109118 public function testStaticCreateJsonArray ()
110119 {
111120 $ response = JsonResponse::create ([0 , 1 , 2 , 3 ]);
112121 $ this ->assertInstanceOf ('Symfony\Component\HttpFoundation\JsonResponse ' , $ response );
113122 $ this ->assertSame ('[0,1,2,3] ' , $ response ->getContent ());
114123 }
115124
125+ /**
126+ * @group legacy
127+ */
116128 public function testStaticCreateJsonObject ()
117129 {
118130 $ response = JsonResponse::create (['foo ' => 'bar ' ]);
119131 $ this ->assertInstanceOf ('Symfony\Component\HttpFoundation\JsonResponse ' , $ response );
120132 $ this ->assertSame ('{"foo":"bar"} ' , $ response ->getContent ());
121133 }
122134
135+ /**
136+ * @group legacy
137+ */
123138 public function testStaticCreateWithSimpleTypes ()
124139 {
125140 $ response = JsonResponse::create ('foo ' );
@@ -140,25 +155,37 @@ public function testStaticCreateWithSimpleTypes()
140155 $ this ->assertSame ('true ' , $ response ->getContent ());
141156 }
142157
158+ /**
159+ * @group legacy
160+ */
143161 public function testStaticCreateWithCustomStatus ()
144162 {
145163 $ response = JsonResponse::create ([], 202 );
146164 $ this ->assertSame (202 , $ response ->getStatusCode ());
147165 }
148166
167+ /**
168+ * @group legacy
169+ */
149170 public function testStaticCreateAddsContentTypeHeader ()
150171 {
151172 $ response = JsonResponse::create ();
152173 $ this ->assertSame ('application/json ' , $ response ->headers ->get ('Content-Type ' ));
153174 }
154175
176+ /**
177+ * @group legacy
178+ */
155179 public function testStaticCreateWithCustomHeaders ()
156180 {
157181 $ response = JsonResponse::create ([], 200 , ['ETag ' => 'foo ' ]);
158182 $ this ->assertSame ('application/json ' , $ response ->headers ->get ('Content-Type ' ));
159183 $ this ->assertSame ('foo ' , $ response ->headers ->get ('ETag ' ));
160184 }
161185
186+ /**
187+ * @group legacy
188+ */
162189 public function testStaticCreateWithCustomContentType ()
163190 {
164191 $ headers = ['Content-Type ' => 'application/vnd.acme.blog-v1+json ' ];
@@ -169,7 +196,7 @@ public function testStaticCreateWithCustomContentType()
169196
170197 public function testSetCallback ()
171198 {
172- $ response = JsonResponse:: create (['foo ' => 'bar ' ])->setCallback ('callback ' );
199+ $ response = ( new JsonResponse (['foo ' => 'bar ' ]) )->setCallback ('callback ' );
173200
174201 $ this ->assertEquals ('/**/callback({"foo":"bar"}); ' , $ response ->getContent ());
175202 $ this ->assertEquals ('text/javascript ' , $ response ->headers ->get ('Content-Type ' ));
@@ -217,7 +244,7 @@ public function testSetCallbackInvalidIdentifier()
217244 public function testSetContent ()
218245 {
219246 $ this ->expectException ('InvalidArgumentException ' );
220- JsonResponse:: create ("\xB1\x31" );
247+ new JsonResponse ("\xB1\x31" );
221248 }
222249
223250 public function testSetContentJsonSerializeError ()
@@ -230,12 +257,12 @@ public function testSetContentJsonSerializeError()
230257
231258 $ serializable = new JsonSerializableObject ();
232259
233- JsonResponse:: create ($ serializable );
260+ new JsonResponse ($ serializable );
234261 }
235262
236263 public function testSetComplexCallback ()
237264 {
238- $ response = JsonResponse:: create (['foo ' => 'bar ' ]);
265+ $ response = new JsonResponse (['foo ' => 'bar ' ]);
239266 $ response ->setCallback ('ಠ_ಠ["foo"].bar[0] ' );
240267
241268 $ this ->assertEquals ('/**/ಠ_ಠ["foo"].bar[0]({"foo":"bar"}); ' , $ response ->getContent ());
0 commit comments