Router::GET]); $respone = $search->run(['q' => static::OTHER_USER['name']]); $json = $this->toJson($respone); self::assertOtherUser($json[0]); } /** * Test the api_users_search() function with an XML result. * * @return void */ public function testApiUsersSearchWithXml() { $search = new Search(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET], ['extension' => ICanCreateResponses::TYPE_XML]); $respone = $search->run(['q' => static::OTHER_USER['name']]); self::assertXml((string)$respone->getBody(), 'users'); } /** * Test the api_users_search() function without a GET q parameter. * * @return void */ public function testApiUsersSearchWithoutQuery() { $this->expectException(BadRequestException::class); $search = new Search(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET]); $search->run(); } }