ILIAS  release_8 Revision v8.24
class.InternalRequestService.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\Test;
20
22
24{
26
27 protected \ILIAS\HTTP\Services $http;
28 protected array $params;
29
30 public function __construct(
31 \ILIAS\HTTP\Services $http,
32 \ILIAS\Refinery\Factory $refinery
33 ) {
34 $this->initRequest(
35 $http,
37 );
38 }
39
40 public function isset(string $key): bool
41 {
42 return $this->raw($key) !== null;
43 }
44
45 public function hasRefId(): int
46 {
47 return $this->raw('ref_id') !== null;
48 }
49
50 public function getRefId(): int
51 {
52 return $this->int("ref_id");
53 }
54
56 public function getIds(): array
57 {
58 return $this->strArray("id");
59 }
60
61 public function hasQuestionId(): bool
62 {
63 return $this->raw('q_id') !== null;
64 }
65
66 public function getQuestionId(): int
67 {
68 return $this->int('q_id');
69 }
70
71 public function getQuestionIds(): array
72 {
73 return $this->intArray('q_id');
74 }
75
76 public function getCallingTest(): int
77 {
78 return $this->int('calling_test');
79 }
80
81 public function getNextCommand(): string
82 {
83 return $this->str('nextCommand');
84 }
85
86 public function getActiveId(): int
87 {
88 return $this->int('active_id');
89 }
90
91 public function getPassId(): int
92 {
93 return $this->int('pass_id');
94 }
95
99 public function raw(string $key)
100 {
101 $no_transform = $this->refinery->identity();
102 return $this->get($key, $no_transform);
103 }
104
105 public function strVal(string $key): string
106 {
107 return $this->str($key);
108 }
109
110 public function getParsedBody(): ?array
111 {
112 return $this->http->request()->getParsedBody();
113 }
114}
__construct(\ILIAS\HTTP\Services $http, \ILIAS\Refinery\Factory $refinery)
static http()
Fetches the global http state from ILIAS.
string $key
Consumer key/client ID value.
Definition: System.php:193
Refinery Factory $refinery
trait BaseGUIRequest
Base gui request wrapper.
initRequest(HTTP\Services $http, Refinery\Factory $refinery, ?array $passed_query_params=null, ?array $passed_post_data=null)
Query params and post data parameters are used for testing.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.