ILIAS  release_8 Revision v8.24
MultilingualismStandardGUIRequestTest.php
Go to the documentation of this file.
1<?php
2
3use PHPUnit\Framework\TestCase;
4
11{
12 protected function tearDown(): void
13 {
14 }
15
16 protected function getRequest(array $get, array $post): \ILIAS\Multilingualism\StandardGUIRequest
17 {
18 $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
19 $lng_mock = $this->createMock(ilLanguage::class);
20 $data = new \ILIAS\Data\Factory();
21 $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
22 return new \ILIAS\Multilingualism\StandardGUIRequest(
23 $http_mock,
25 $get,
26 $post
27 );
28 }
29
30 public function testRefId(): void
31 {
32 $request = $this->getRequest(
33 [
34 ],
35 [
36 "lang" => [
37 "en" => "English",
38 "de" => "German"
39 ]
40 ]
41 );
42
43 $this->assertEquals(
44 [
45 "en" => "English",
46 "de" => "German"
47 ],
48 $request->getLanguages()
49 );
50 }
51}
$post
Definition: ltitoken.php:49
Refinery Factory $refinery
Class ChatMainBarProvider \MainMenu\Provider.