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