1
0
Fork 0

Move Api\unsupported tests and remove dependency to System::jsonExit()

This commit is contained in:
Philipp Holzer 2021-11-12 22:44:59 +01:00
commit e7f84d4934
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
5 changed files with 52 additions and 50 deletions

View file

@ -499,23 +499,6 @@ class ApiTest extends FixtureTest
*/
}
/**
* Test the api_call() function with an unimplemented API.
*
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function testApiCallWithUninplementedApi()
{
// @todo How to test the new API?
/*
self::assertEquals(
'{"status":{"error":"Not Found","code":"404 Not Found","request":""}}',
api_call($this->app)
);
*/
}
/**
* Test the api_call() function with a JSON result.
*
@ -622,35 +605,6 @@ class ApiTest extends FixtureTest
);
}
/**
* Test the api_call() function with an unauthorized user.
*
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function testApiCallWithWrongAuth()
{
// @todo How to test the new API?
/*
global $API;
$API['api_path'] = [
'method' => 'method',
'auth' => true
];
$_SESSION['authenticated'] = false;
$_SERVER['REQUEST_METHOD'] = 'method';
$_SERVER['QUERY_STRING'] = 'pagename=api_path';
$args = DI::args()->determine($_SERVER, $_GET);
self::assertEquals(
'{"status":{"error":"This API requires login","code":"401 Unauthorized","request":"api_path"}}',
api_call($this->app, $args)
);
*/
}
/**
* Test the api_rss_extra() function.
*