ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ContentStyleStandardGUIRequestTest.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
50 public function testRefId(): void
51 {
52 $request = $this->getRequest(
53 [
54 "ref_id" => "5"
55 ],
56 []
57 );
58
59 $this->assertEquals(
60 5,
61 $request->getRefId()
62 );
63 }
64
65
66 public function testTemplateId(): void
67 {
68 $request = $this->getRequest(
69 [
70 "t_id" => "7"
71 ],
72 []
73 );
74
75 $this->assertEquals(
76 7,
77 $request->getTemplateId()
78 );
79 }
80
81 public function testCharacteristics(): void
82 {
83 $request = $this->getRequest(
84 [
85 ],
86 [
87 "char" => [
88 "Foo",
89 "Bar"
90 ]
91 ]
92 );
93
94 $this->assertEquals(
95 ["Foo", "Bar"],
96 $request->getCharacteristics()
97 );
98 }
99}
Builds data types.
Definition: Factory.php:36
$post
Definition: ltitoken.php:46
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.