ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
LikeStandardGUIRequestTest.php
Go to the documentation of this file.
1 <?php
2 
4 
8 class LikeStandardGUIRequestTest extends TestCase
9 {
10  protected function tearDown(): void
11  {
12  }
13 
14  protected function getRequest(array $get, array $post): \ILIAS\Like\StandardGUIRequest
15  {
16  $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
17  $lng_mock = $this->createMock(ilLanguage::class);
18  $data = new \ILIAS\Data\Factory();
19  $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
20  return new \ILIAS\Like\StandardGUIRequest(
21  $http_mock,
22  $refinery,
23  $get,
24  $post
25  );
26  }
27 
28  public function testValue(): void
29  {
30  $request = $this->getRequest(
31  [
32  "val" => "5"
33  ],
34  []
35  );
36 
37  $this->assertEquals(
38  5,
39  $request->getValue()
40  );
41  }
42 
43  public function testExpressionKey(): void
44  {
45  $request = $this->getRequest(
46  [
47  "exp" => "2"
48  ],
49  []
50  );
51 
52  $this->assertEquals(
53  2,
54  $request->getExpressionKey()
55  );
56  }
57 
58  public function testModalSignalId(): void
59  {
60  $request = $this->getRequest(
61  [
62  "modal_show_sig_id" => "yxc12"
63  ],
64  []
65  );
66 
67  $this->assertEquals(
68  "yxc12",
69  $request->getModalSignalId()
70  );
71  }
72 }
Class ChatMainBarProvider .
getRequest(array $get, array $post)
$post
Definition: ltitoken.php:49
Refinery Factory $refinery