Fix BaseApi and corresponding tests
This commit is contained in:
@@ -21,12 +21,14 @@
|
||||
|
||||
namespace Friendica\Test\src\Module\Api;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\DI;
|
||||
use Friendica\Security\Authentication;
|
||||
use Friendica\Test\FixtureTest;
|
||||
use Friendica\Test\Util\AppDouble;
|
||||
use Friendica\Test\Util\AuthenticationDouble;
|
||||
|
||||
abstract class ApiTest extends FixtureTest
|
||||
@@ -51,9 +53,13 @@ abstract class ApiTest extends FixtureTest
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
$this->dice = $this->dice
|
||||
->addRule(Authentication::class, ['instanceOf' => AuthenticationDouble::class, 'shared' => true]);
|
||||
->addRule(Authentication::class, ['instanceOf' => AuthenticationDouble::class, 'shared' => true])
|
||||
->addRule(App::class, ['instanceOf' => AppDouble::class, 'shared' => true]);
|
||||
DI::init($this->dice);
|
||||
|
||||
// Manual overwrite for API testrs :-)
|
||||
DI::app()->setIsLoggedIn(true);
|
||||
|
||||
$this->installAuthTest();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user