Move Arguments reset to right place

This commit is contained in:
Philipp 2022-01-02 22:54:07 +01:00
parent 5e85939502
commit c1f2e391b0
No known key found for this signature in database
GPG Key ID: 24A7501396EB5432
2 changed files with 11 additions and 13 deletions

View File

@ -32,10 +32,19 @@ abstract class FixtureTest extends DatabaseTest
{ {
parent::setUp(); parent::setUp();
$server = $_SERVER;
$server['REQUEST_METHOD'] = Router::GET;
$this->dice = (new Dice()) $this->dice = (new Dice())
->addRules(include __DIR__ . '/../static/dependencies.config.php') ->addRules(include __DIR__ . '/../static/dependencies.config.php')
->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]) ->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true])
->addRule(IHandleSessions::class, ['instanceOf' => Session\Type\Memory::class, 'shared' => true, 'call' => null]); ->addRule(IHandleSessions::class, ['instanceOf' => Session\Type\Memory::class, 'shared' => true, 'call' => null])
->addRule(Arguments::class, [
'instanceOf' => Arguments::class,
'call' => [
['determine', [$server, $_GET], Dice::CHAIN_CALL],
],
]);
DI::init($this->dice); DI::init($this->dice);
/** @var IManageConfigValues $config */ /** @var IManageConfigValues $config */

View File

@ -21,9 +21,7 @@
namespace Friendica\Test\src\Module\Api; namespace Friendica\Test\src\Module\Api;
use Dice\Dice;
use Friendica\App; use Friendica\App;
use Friendica\App\Arguments;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Hook; use Friendica\Core\Hook;
@ -169,18 +167,9 @@ abstract class ApiTest extends FixtureTest
{ {
parent::setUp(); // TODO: Change the autogenerated stub parent::setUp(); // TODO: Change the autogenerated stub
$server = $_SERVER;
$server['REQUEST_METHOD'] = App\Router::GET;
$this->dice = $this->dice $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]) ->addRule(App::class, ['instanceOf' => AppDouble::class, 'shared' => true]);
->addRule(Arguments::class, [
'instanceOf' => App\Arguments::class,
'call' => [
['determine', [$server, $_GET], Dice::CHAIN_CALL],
],
]);
DI::init($this->dice); DI::init($this->dice);
// Manual override to bypass API authentication // Manual override to bypass API authentication