ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
GloPresentationGUIRequestTest.php
Go to the documentation of this file.
1<?php
2
19use PHPUnit\Framework\TestCase;
20
26class GloPresentationGUIRequestTest extends TestCase
27{
28 protected function getRequest(array $get, array $post): \ILIAS\Glossary\Presentation\PresentationGUIRequest
29 {
30 $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
31 $lng_mock = $this->createMock(ilLanguage::class);
32 $data = new \ILIAS\Data\Factory();
33 $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
34 return new \ILIAS\Glossary\Presentation\PresentationGUIRequest(
35 $http_mock,
37 $get,
38 $post
39 );
40 }
41
42 public function testRefId(): void
43 {
44 $request = $this->getRequest(
45 [
46 "ref_id" => "5"
47 ],
48 []
49 );
50
51 $this->assertEquals(
52 5,
53 $request->getRefId()
54 );
55 }
56
57 public function testLetter(): void
58 {
59 $request = $this->getRequest(
60 [
61 "letter" => "a"
62 ],
63 []
64 );
65
66 $this->assertEquals(
67 "a",
68 $request->getLetter()
69 );
70 }
71
72 public function testTermId(): void
73 {
74 $request = $this->getRequest(
75 [
76 "term_id" => "14"
77 ],
78 []
79 );
80
81 $this->assertEquals(
82 14,
83 $request->getTermId()
84 );
85 }
86}
$post
Definition: ltitoken.php:46
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.