ILIAS  release_8 Revision v8.24
InfoScreenStandardGUIRequestTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5use PHPUnit\Framework\TestCase;
8
15{
16 protected function tearDown(): void
17 {
18 }
19
20 protected function getRequest(array $get, array $post): StandardGUIRequest
21 {
22 $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
23 $lng_mock = $this->createMock(ilLanguage::class);
24 $data = new Factory();
25 $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
26 return new StandardGUIRequest(
27 $http_mock,
29 $get,
30 $post
31 );
32 }
33
37 public function testUserId()
38 {
39 $request = $this->getRequest(
40 [
41 "user_id" => "57"
42 ],
43 []
44 );
45
46 $this->assertEquals(
47 57,
48 $request->getUserId()
49 );
50 }
51
55 public function testLPEdit()
56 {
57 $request = $this->getRequest(
58 [
59 ],
60 [
61 "lp_edit" => "1"
62 ]
63 );
64
65 $this->assertEquals(
66 1,
67 $request->getLPEdit()
68 );
69 }
70}
Builds data types.
Definition: Factory.php:21
$post
Definition: ltitoken.php:49
Refinery Factory $refinery
Class ChatMainBarProvider \MainMenu\Provider.