ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
InfoScreenStandardGUIRequestTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use PHPUnit\Framework\TestCase;
24
31{
32 protected function tearDown(): void
33 {
34 }
35
36 protected function getRequest(array $get, array $post): StandardGUIRequest
37 {
38 $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
39 $lng_mock = $this->createMock(ilLanguage::class);
40 $data = new Factory();
41 $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
42 return new StandardGUIRequest(
43 $http_mock,
45 $get,
46 $post
47 );
48 }
49
53 public function testUserId()
54 {
55 $request = $this->getRequest(
56 [
57 "user_id" => "57"
58 ],
59 []
60 );
61
62 $this->assertEquals(
63 57,
64 $request->getUserId()
65 );
66 }
67
71 public function testLPEdit()
72 {
73 $request = $this->getRequest(
74 [
75 ],
76 [
77 "lp_edit" => "1"
78 ]
79 );
80
81 $this->assertEquals(
82 1,
83 $request->getLPEdit()
84 );
85 }
86}
Builds data types.
Definition: Factory.php:36
$post
Definition: ltitoken.php:46
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.