ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PostDataFromServerRequestTest Class Reference
+ Inheritance diagram for PostDataFromServerRequestTest:
+ Collaboration diagram for PostDataFromServerRequestTest:

Public Member Functions

 setUp ()
 
 test_get_success ()
 
 test_get_fail ()
 
 test_getOr_match ()
 
 test_getOr_no_match ()
 

Detailed Description

Definition at line 11 of file PostDataFromServerRequestTest.php.

Member Function Documentation

◆ setUp()

PostDataFromServerRequestTest::setUp ( )

Definition at line 13 of file PostDataFromServerRequestTest.php.

References $request.

14  {
15  $request = \Mockery::mock(ServerRequestInterface::class);
16  $request->shouldReceive("getParsedBody")->andReturn(["foo" => "bar"]);
17  $this->post_data = new PostDataFromServerRequest($request);
18  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
Implements interaction of input element with post data from psr-7 server request. ...

◆ test_get_fail()

PostDataFromServerRequestTest::test_get_fail ( )

Definition at line 27 of file PostDataFromServerRequestTest.php.

28  {
29  $raised = false;
30  try {
31  $this->post_data->get("baz");
32  } catch (\LogicException $e) {
33  $raised = true;
34  }
35  $this->assertTrue($raised, "Logic exception was raised.");
36  }

◆ test_get_success()

PostDataFromServerRequestTest::test_get_success ( )

Definition at line 21 of file PostDataFromServerRequestTest.php.

22  {
23  $this->assertEquals("bar", $this->post_data->get("foo"));
24  }

◆ test_getOr_match()

PostDataFromServerRequestTest::test_getOr_match ( )

Definition at line 39 of file PostDataFromServerRequestTest.php.

40  {
41  $this->assertEquals("bar", $this->post_data->getOr("foo", "baz"));
42  }

◆ test_getOr_no_match()

PostDataFromServerRequestTest::test_getOr_no_match ( )

Definition at line 45 of file PostDataFromServerRequestTest.php.

46  {
47  $this->assertEquals("blaw", $this->post_data->getOr("baz", "blaw"));
48  }

The documentation for this class was generated from the following file: