ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
PostDataFromServerRequestTest Class Reference
+ Inheritance diagram for PostDataFromServerRequestTest:
+ Collaboration diagram for PostDataFromServerRequestTest:

Public Member Functions

 setUp ()
 
 testGetSuccess ()
 
 testGetFail ()
 
 testGetOrMatch ()
 
 testGetOrNoMatch ()
 

Protected Attributes

PostDataFromServerRequest $post_data
 

Detailed Description

Definition at line 27 of file PostDataFromServerRequestTestTBD.php.

Member Function Documentation

◆ setUp()

PostDataFromServerRequestTest::setUp ( )

Definition at line 31 of file PostDataFromServerRequestTestTBD.php.

31  : void
32  {
33  $request = Mockery::mock(ServerRequestInterface::class);
34  $request->shouldReceive("getParsedBody")->andReturn(["foo" => "bar"]);
35  $this->post_data = new PostDataFromServerRequest($request);
36  }
Implements interaction of input element with post data from psr-7 server request. ...

◆ testGetFail()

PostDataFromServerRequestTest::testGetFail ( )

Definition at line 43 of file PostDataFromServerRequestTestTBD.php.

References Vendor\Package\$e.

43  : void
44  {
45  $raised = false;
46  try {
47  $this->post_data->get("baz");
48  } catch (LogicException $e) {
49  $raised = true;
50  }
51  $this->assertTrue($raised, "Logic exception was raised.");
52  }

◆ testGetOrMatch()

PostDataFromServerRequestTest::testGetOrMatch ( )

Definition at line 54 of file PostDataFromServerRequestTestTBD.php.

54  : void
55  {
56  $this->assertEquals("bar", $this->post_data->getOr("foo", "baz"));
57  }

◆ testGetOrNoMatch()

PostDataFromServerRequestTest::testGetOrNoMatch ( )

Definition at line 59 of file PostDataFromServerRequestTestTBD.php.

59  : void
60  {
61  $this->assertEquals("blaw", $this->post_data->getOr("baz", "blaw"));
62  }

◆ testGetSuccess()

PostDataFromServerRequestTest::testGetSuccess ( )

Definition at line 38 of file PostDataFromServerRequestTestTBD.php.

38  : void
39  {
40  $this->assertEquals("bar", $this->post_data->get("foo"));
41  }

Field Documentation

◆ $post_data

PostDataFromServerRequest PostDataFromServerRequestTest::$post_data
protected

Definition at line 29 of file PostDataFromServerRequestTestTBD.php.


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