ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
LikeStandardGUIRequestTest.php
Go to the documentation of this file.
1<?php
2
19use PHPUnit\Framework\TestCase;
20
24class LikeStandardGUIRequestTest extends TestCase
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,
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}
getRequest(array $get, array $post)
$post
Definition: ltitoken.php:46
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.