This commit is contained in:
Philipp 2021-11-30 20:53:47 +01:00
parent 68655d0dcb
commit 901068f770
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
5 changed files with 126 additions and 93 deletions

View file

@ -27,9 +27,11 @@ use Friendica\Core\Hook;
use Friendica\Database\Database;
use Friendica\DI;
use Friendica\Security\Authentication;
use Friendica\Security\BasicAuth;
use Friendica\Test\FixtureTest;
use Friendica\Test\Util\AppDouble;
use Friendica\Test\Util\AuthenticationDouble;
use Friendica\Test\Util\AuthTestConfig;
abstract class ApiTest extends FixtureTest
{
@ -60,9 +62,19 @@ abstract class ApiTest extends FixtureTest
// Manual override to bypass API authentication
DI::app()->setIsLoggedIn(true);
AuthTestConfig::$authenticated = true;
AuthTestConfig::$user_id = 42;
$this->installAuthTest();
}
protected function tearDown(): void
{
BasicAuth::setCurrentUserID();
parent::tearDown(); // TODO: Change the autogenerated stub
}
/**
* installs auththest.
*