From 4f1b917e42316f8d543e44135887e305594d940a Mon Sep 17 00:00:00 2001 From: Art4 Date: Sun, 15 Dec 2024 22:15:46 +0000 Subject: [PATCH] Remove unused AppDouble class --- tests/ApiTestCase.php | 7 +------ tests/Util/AppDouble.php | 36 ------------------------------------ 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 tests/Util/AppDouble.php diff --git a/tests/ApiTestCase.php b/tests/ApiTestCase.php index 26a6bb08ca..a9c04249c2 100644 --- a/tests/ApiTestCase.php +++ b/tests/ApiTestCase.php @@ -7,7 +7,6 @@ namespace Friendica\Test; -use Friendica\App; use Friendica\Capabilities\ICanCreateResponses; use Friendica\Core\Addon; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -16,7 +15,6 @@ use Friendica\DI; use Friendica\Module\Special\HTTPException; use Friendica\Security\Authentication; use Friendica\Security\BasicAuth; -use Friendica\Test\Util\AppDouble; use Friendica\Test\Util\AuthenticationDouble; use Friendica\Test\Util\AuthTestConfig; use Psr\Http\Message\ResponseInterface; @@ -158,12 +156,9 @@ abstract class ApiTestCase extends FixtureTestCase $this->dice = $this->dice ->addRule(Authentication::class, ['instanceOf' => AuthenticationDouble::class, 'shared' => true]) - ->addRule(App::class, ['instanceOf' => AppDouble::class, 'shared' => true]); + ; DI::init($this->dice); - // Manual override to bypass API authentication - DI::app()->setIsLoggedIn(true); - $this->httpExceptionMock = $this->dice->create(HTTPException::class); AuthTestConfig::$authenticated = true; diff --git a/tests/Util/AppDouble.php b/tests/Util/AppDouble.php deleted file mode 100644 index 305b7ccf7c..0000000000 --- a/tests/Util/AppDouble.php +++ /dev/null @@ -1,36 +0,0 @@ -isLoggedIn = $isLoggedIn; - } - - public function isLoggedIn(): bool - { - return $this->isLoggedIn; - } -}