ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
LikeStandardGUIRequestTest.php
Go to the documentation of this file.
1 <?php
2 
20 
25 {
26  protected function tearDown(): void
27  {
28  }
29 
30  protected function getRequest(array $get, array $post): \ILIAS\Like\StandardGUIRequest
31  {
32  $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
33  $lng_mock = $this->createMock(ilLanguage::class);
34  $data = new \ILIAS\Data\Factory();
35  $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
36  return new \ILIAS\Like\StandardGUIRequest(
37  $http_mock,
38  $refinery,
39  $get,
40  $post
41  );
42  }
43 
44  public function testValue(): void
45  {
46  $request = $this->getRequest(
47  [
48  "val" => "5"
49  ],
50  []
51  );
52 
53  $this->assertEquals(
54  5,
55  $request->getValue()
56  );
57  }
58 
59  public function testExpressionKey(): void
60  {
61  $request = $this->getRequest(
62  [
63  "exp" => "2"
64  ],
65  []
66  );
67 
68  $this->assertEquals(
69  2,
70  $request->getExpressionKey()
71  );
72  }
73 
74  public function testModalSignalId(): void
75  {
76  $request = $this->getRequest(
77  [
78  "modal_show_sig_id" => "yxc12"
79  ],
80  []
81  );
82 
83  $this->assertEquals(
84  "yxc12",
85  $request->getModalSignalId()
86  );
87  }
88 }
Interface Observer Contains several chained tasks and infos about them.
getRequest(array $get, array $post)
$post
Definition: ltitoken.php:46