ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
AccordionStandardGUIRequestTest.php
Go to the documentation of this file.
1<?php
2
19use PHPUnit\Framework\TestCase;
20
26class AccordionStandardGUIRequestTest extends TestCase
27{
28 protected function setUp(): void
29 {
30 parent::setUp();
31 }
32
33 protected function tearDown(): void
34 {
35 }
36
37 protected function getRequest(array $get, array $post): \ILIAS\Accordion\StandardGUIRequest
38 {
39 $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
40 $lng_mock = $this->createMock(ilLanguage::class);
41 $data = new \ILIAS\Data\Factory();
42 $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
43 return new \ILIAS\Accordion\StandardGUIRequest(
44 $http_mock,
46 $get,
47 $post
48 );
49 }
50
51 public function testUserId(): void
52 {
53 $request = $this->getRequest(
54 [
55 "user_id" => "5"
56 ],
57 []
58 );
59
60 $this->assertEquals(
61 5,
62 $request->getUserId()
63 );
64 }
65
66
67 public function testTabNr(): void
68 {
69 $request = $this->getRequest(
70 [
71 "tab_nr" => "7"
72 ],
73 []
74 );
75
76 $this->assertEquals(
77 7,
78 $request->getTabNr()
79 );
80 }
81}
$post
Definition: ltitoken.php:46
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.