]> git.mxchange.org Git - friendica.git/blobdiff - tests/ApiTest.php
Refactoring Installation
[friendica.git] / tests / ApiTest.php
index 941ed96bf8b6078ea00443c4138e83ed9f7984d1..c509c7d2a4233b3ea69ab5b7a6d823246ae357da 100644 (file)
@@ -12,6 +12,8 @@ use Friendica\Core\Protocol;
 use Friendica\Core\System;
 use Friendica\Network\HTTPException;
 
+require_once __DIR__ . '/../include/api.php';
+
 /**
  * Tests for the API functions.
  *
@@ -20,15 +22,13 @@ use Friendica\Network\HTTPException;
  */
 class ApiTest extends DatabaseTest
 {
-
        /**
         * Create variables used by tests.
         */
-       protected function setUp()
+       public function setUp()
        {
                parent::setUp();
 
-               // Reusable App object
                $this->app = BaseObject::getApp();
 
                // User data that the test database is populated with
@@ -61,6 +61,10 @@ class ApiTest extends DatabaseTest
                        '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);
@@ -76,9 +80,8 @@ class ApiTest extends DatabaseTest
        {
                parent::tearDown();
 
-               $app = get_app();
-               $app->argc = 1;
-               $app->argv = ['home'];
+               $this->app->argc = 1;
+               $this->app->argv = ['home'];
        }
 
        /**
@@ -3376,7 +3379,7 @@ class ApiTest extends DatabaseTest
         */
        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();