Introduce FixtureTest::useHttpMethod for manually overwrite the HTTP Method argument
This commit is contained in:
parent
4e67bfed8d
commit
5e85939502
36 changed files with 175 additions and 82 deletions
|
@ -6,6 +6,8 @@
|
|||
namespace Friendica\Test;
|
||||
|
||||
use Dice\Dice;
|
||||
use Friendica\App\Arguments;
|
||||
use Friendica\App\Router;
|
||||
use Friendica\Core\Config\ValueObject\Cache;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Session;
|
||||
|
@ -50,4 +52,20 @@ abstract class FixtureTest extends DatabaseTest
|
|||
// Load the API dataset for the whole API
|
||||
$this->loadFixture(__DIR__ . '/datasets/api.fixture.php', $dba);
|
||||
}
|
||||
|
||||
protected function useHttpMethod(string $method = Router::GET)
|
||||
{
|
||||
$server = $_SERVER;
|
||||
$server['REQUEST_METHOD'] = $method;
|
||||
|
||||
$this->dice = $this->dice
|
||||
->addRule(Arguments::class, [
|
||||
'instanceOf' => Arguments::class,
|
||||
'call' => [
|
||||
['determine', [$server, $_GET], Dice::CHAIN_CALL],
|
||||
],
|
||||
]);
|
||||
|
||||
DI::init($this->dice);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue