Move Arguments reset to right place
This commit is contained in:
parent
5e85939502
commit
c1f2e391b0
|
@ -32,10 +32,19 @@ abstract class FixtureTest extends DatabaseTest
|
|||
{
|
||||
parent::setUp();
|
||||
|
||||
$server = $_SERVER;
|
||||
$server['REQUEST_METHOD'] = Router::GET;
|
||||
|
||||
$this->dice = (new Dice())
|
||||
->addRules(include __DIR__ . '/../static/dependencies.config.php')
|
||||
->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);
|
||||
|
||||
/** @var IManageConfigValues $config */
|
||||
|
|
|
@ -21,9 +21,7 @@
|
|||
|
||||
namespace Friendica\Test\src\Module\Api;
|
||||
|
||||
use Dice\Dice;
|
||||
use Friendica\App;
|
||||
use Friendica\App\Arguments;
|
||||
use Friendica\Capabilities\ICanCreateResponses;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\Hook;
|
||||
|
@ -169,18 +167,9 @@ abstract class ApiTest extends FixtureTest
|
|||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
$server = $_SERVER;
|
||||
$server['REQUEST_METHOD'] = App\Router::GET;
|
||||
|
||||
$this->dice = $this->dice
|
||||
->addRule(Authentication::class, ['instanceOf' => AuthenticationDouble::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],
|
||||
],
|
||||
]);
|
||||
->addRule(App::class, ['instanceOf' => AppDouble::class, 'shared' => true]);
|
||||
DI::init($this->dice);
|
||||
|
||||
// Manual override to bypass API authentication
|
||||
|
|
Loading…
Reference in New Issue
Block a user