ILIAS  release_8 Revision v8.24
MediaCastStandardGUIRequestTest.php
Go to the documentation of this file.
1<?php
2
3use PHPUnit\Framework\TestCase;
4
8class MediaCastStandardGUIRequestTest extends TestCase
9{
10 //protected $backupGlobals = false;
11
12 protected function tearDown(): void
13 {
14 }
15
16 protected function getRequest(array $get, array $post): \ILIAS\MediaCast\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\MediaCast\StandardGUIRequest(
23 $http_mock,
25 $get,
26 $post
27 );
28 }
29
30 public function testRefId(): void
31 {
32 $request = $this->getRequest(
33 [
34 "ref_id" => "5"
35 ],
36 []
37 );
38
39 $this->assertEquals(
40 5,
41 $request->getRefId()
42 );
43 }
44
45 public function testMimeTypes(): void
46 {
47 $request = $this->getRequest(
48 [
49 "mimetypes" => "a,b"
50 ],
51 []
52 );
53
54 $this->assertEquals(
55 "a,b",
56 $request->getMimeTypes()
57 );
58 }
59
60 public function testItemIds(): void
61 {
62 $request = $this->getRequest(
63 [
64 ],
65 [
66 "item_id" => ["4", "7", "8"]
67 ]
68 );
69
70 $this->assertEquals(
71 [4,7,8],
72 $request->getItemIds()
73 );
74 }
75
76 public function testSeconds(): void
77 {
78 $request = $this->getRequest(
79 [
80 "sec" => "5"
81 ],
82 []
83 );
84
85 $this->assertEquals(
86 5,
87 $request->getSeconds()
88 );
89 }
90}
$post
Definition: ltitoken.php:49
Refinery Factory $refinery
Class ChatMainBarProvider \MainMenu\Provider.