ILIAS  release_8 Revision v8.24
AccordionStandardGUIRequestTest.php
Go to the documentation of this file.
1<?php
2
3use PHPUnit\Framework\TestCase;
4
10class AccordionStandardGUIRequestTest extends TestCase
11{
12 protected function setUp(): void
13 {
14 parent::setUp();
15 }
16
17 protected function tearDown(): void
18 {
19 }
20
21 protected function getRequest(array $get, array $post): \ILIAS\Accordion\StandardGUIRequest
22 {
23 $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
24 $lng_mock = $this->createMock(ilLanguage::class);
25 $data = new \ILIAS\Data\Factory();
26 $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
27 return new \ILIAS\Accordion\StandardGUIRequest(
28 $http_mock,
30 $get,
31 $post
32 );
33 }
34
35 public function testUserId(): void
36 {
37 $request = $this->getRequest(
38 [
39 "user_id" => "5"
40 ],
41 []
42 );
43
44 $this->assertEquals(
45 5,
46 $request->getUserId()
47 );
48 }
49
50
51 public function testTabNr(): void
52 {
53 $request = $this->getRequest(
54 [
55 "tab_nr" => "7"
56 ],
57 []
58 );
59
60 $this->assertEquals(
61 7,
62 $request->getTabNr()
63 );
64 }
65}
$post
Definition: ltitoken.php:49
Refinery Factory $refinery
Class ChatMainBarProvider \MainMenu\Provider.