controller = new JsonController($this->container); } /** * Test the json() function. * * @return void * @requires download */ public function testJson() { $this->assertRequestIsOk('json', ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU']); } /** * Test the json() function with an error. * * @return void * @requires download */ public function testJsonWithError() { $this->expectException(YoutubedlException::class); $this->getRequestResult('json', ['url' => 'https://example.com/foo']); } /** * Test the json() function without the URL parameter. * * @return void */ public function testJsonWithoutUrl() { $this->assertRequestIsClientError('json'); } }