[BUGFIX] Fixed InputHandler::find and InputHandler::value failing when using array methods.

This commit is contained in:
Simon Sessingø
2021-03-29 18:45:49 +02:00
parent 06ee78a48f
commit adc879bb13
2 changed files with 17 additions and 0 deletions

View File

@@ -122,7 +122,20 @@ class InputHandlerTest extends \PHPUnit\Framework\TestCase
$_GET = [];
}
public function testFindInput() {
global $_POST;
$_POST['hello'] = 'motto';
$router = TestRouter::router();
$router->reset();
$router->getRequest()->setMethod('post');
$inputHandler = TestRouter::request()->getInputHandler();
$value = $inputHandler->value('hello', null, \Pecee\Http\Request::$requestTypesPost);
$this->assertEquals($_POST['hello'], $value);
}
public function testFile()
{