Move Api\unsupported tests and remove dependency to System::jsonExit()
This commit is contained in:
parent
c0219fe2fa
commit
e7f84d4934
5 changed files with 52 additions and 50 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue