5require_once(__DIR__ .
"/../../../../../../libs/composer/vendor/autoload.php");
7use \ILIAS\UI\Implementation\Component\Input\Container\Form\PostDataFromServerRequest;
9use Psr\Http\Message\ServerRequestInterface;
10use PHPUnit\Framework\TestCase;
16 $request = \Mockery::mock(ServerRequestInterface::class);
17 $request->shouldReceive(
"getParsedBody")->andReturn([
"foo" =>
"bar"]);
24 $this->assertEquals(
"bar", $this->post_data->get(
"foo"));
32 $this->post_data->get(
"baz");
33 }
catch (\LogicException
$e) {
36 $this->assertTrue($raised,
"Logic exception was raised.");
42 $this->assertEquals(
"bar", $this->post_data->getOr(
"foo",
"baz"));
48 $this->assertEquals(
"blaw", $this->post_data->getOr(
"baz",
"blaw"));
An exception for terminatinating execution or to throw for unit testing.
Implements interaction of input element with post data from psr-7 server request.