. // }}} namespace App\Tests\Core; use App\Util\GNUsocialTestCase; use Jchook\AssertThrows\AssertThrows; class ControllerTest extends GNUsocialTestCase { use AssertThrows; public function testJSONRequest() { // `server` will populate $_SERVER on the other side $client = static::createClient(options: [], server: ['HTTP_ACCEPT' => 'application/json']); $client->request('GET', '/feed/public'); $this->assertResponseIsSuccessful(); $response = $client->getResponse(); static::assertTrue(mb_strpos($response->headers->get('content-type'), 'json') !== false); static::assertJson($response->getContent()); } }