use Friendica\Core\System;
use Friendica\Network\HTTPException;
+require_once __DIR__ . '/../include/api.php';
+
/**
* Tests for the API functions.
*
*/
class ApiTest extends DatabaseTest
{
-
/**
* Create variables used by tests.
*/
{
parent::setUp();
- require_once __DIR__.'/../include/api.php';
+ $this->app = BaseObject::getApp();
// User data that the test database is populated with
$this->selfUser = [
'uid' => $this->selfUser['id']
];
+ Config::set('system', 'url', 'http://localhost');
+ Config::set('system', 'hostname', 'localhost');
+ Config::set('system', 'worker_dont_fork', true);
+
// Default config
Config::set('config', 'hostname', 'localhost');
Config::set('system', 'throttle_limit_day', 100);
{
parent::tearDown();
- $app = get_app();
- $app->argc = 1;
- $app->argv = ['home'];
+ $this->app->argc = 1;
+ $this->app->argv = ['home'];
}
/**
*/
public function testApiFriendicaRemoteauthWithCorrectUrl()
{
- $this->markTestIncomplete("We can't use an assertion here because of goaway().");
+ $this->markTestIncomplete("We can't use an assertion here because of App->redirect().");
$_GET['url'] = 'url';
$_GET['c_url'] = $this->selfUser['nurl'];
api_friendica_remoteauth();