ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
MediaTypeManagerTest Class Reference
+ Inheritance diagram for MediaTypeManagerTest:
+ Collaboration diagram for MediaTypeManagerTest:

Public Member Functions

 testIsImage ()
 
 testIsVideo ()
 
 testIsAudio ()
 
 testGetAudioSuffixes ()
 
 testGetVideoSuffixes ()
 
 testGetImageSuffixes ()
 
 testGetOtherSuffixes ()
 
 testGetAudioMimeTypes ()
 
 testGetVideoMimeTypes ()
 
 testGetImageMimeTypes ()
 
 testGetOtherMimeTypes ()
 
 testGetAllowedVideoMimeTypes ()
 
 testGetAllowedVideoSuffixes ()
 
 testIsHtmlAllowed ()
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 
 getTypeManager (array $mime_blacklist=[])
 

Protected Attributes

ILIAS MediaObjects MediaType MediaTypeManager $types
 

Detailed Description

Definition at line 5 of file MediaTypeManagerTest.php.

Member Function Documentation

◆ getTypeManager()

MediaTypeManagerTest::getTypeManager ( array  $mime_blacklist = [])
protected

◆ setUp()

MediaTypeManagerTest::setUp ( )
protected

Definition at line 9 of file MediaTypeManagerTest.php.

9  : void
10  {
11  parent::setUp();
12  }

◆ tearDown()

MediaTypeManagerTest::tearDown ( )
protected

Definition at line 14 of file MediaTypeManagerTest.php.

14  : void
15  {
16  }

◆ testGetAllowedVideoMimeTypes()

MediaTypeManagerTest::testGetAllowedVideoMimeTypes ( )

Definition at line 111 of file MediaTypeManagerTest.php.

References getTypeManager().

111  : void
112  {
113  $tm = $this->getTypeManager(["video/webm"]);
114 
115  $this->assertEquals(
116  true,
117  in_array("video/mp4", iterator_to_array($tm->getAllowedVideoMimeTypes()), true)
118  );
119  $this->assertEquals(
120  false,
121  in_array("video/webm", iterator_to_array($tm->getAllowedVideoMimeTypes()), true)
122  );
123  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testGetAllowedVideoSuffixes()

MediaTypeManagerTest::testGetAllowedVideoSuffixes ( )

Definition at line 125 of file MediaTypeManagerTest.php.

References getTypeManager().

125  : void
126  {
127  $tm = $this->getTypeManager(["video/webm"]);
128 
129  $this->assertEquals(
130  true,
131  in_array("mp4", iterator_to_array($tm->getAllowedVideoSuffixes()), true)
132  );
133  $this->assertEquals(
134  false,
135  in_array("webm", iterator_to_array($tm->getAllowedVideoSuffixes()), true)
136  );
137  $this->assertEquals(
138  false,
139  in_array("png", iterator_to_array($tm->getAllowedVideoSuffixes()), true)
140  );
141  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testGetAudioMimeTypes()

MediaTypeManagerTest::testGetAudioMimeTypes ( )

Definition at line 79 of file MediaTypeManagerTest.php.

References getTypeManager().

79  : void
80  {
81  $this->assertEquals(
82  ["audio/mpeg"],
83  iterator_to_array($this->getTypeManager()->getAudioMimeTypes())
84  );
85  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testGetAudioSuffixes()

MediaTypeManagerTest::testGetAudioSuffixes ( )

Definition at line 47 of file MediaTypeManagerTest.php.

References getTypeManager().

47  : void
48  {
49  $this->assertEquals(
50  ["mp3"],
51  iterator_to_array($this->getTypeManager()->getAudioSuffixes())
52  );
53  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testGetImageMimeTypes()

MediaTypeManagerTest::testGetImageMimeTypes ( )

Definition at line 95 of file MediaTypeManagerTest.php.

References getTypeManager().

95  : void
96  {
97  $this->assertEquals(
98  true,
99  in_array("image/jpeg", iterator_to_array($this->getTypeManager()->getImageMimeTypes()))
100  );
101  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testGetImageSuffixes()

MediaTypeManagerTest::testGetImageSuffixes ( )

Definition at line 63 of file MediaTypeManagerTest.php.

References getTypeManager().

63  : void
64  {
65  $this->assertEquals(
66  true,
67  in_array("png", iterator_to_array($this->getTypeManager()->getImageSuffixes()))
68  );
69  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testGetOtherMimeTypes()

MediaTypeManagerTest::testGetOtherMimeTypes ( )

Definition at line 103 of file MediaTypeManagerTest.php.

References getTypeManager().

103  : void
104  {
105  $this->assertEquals(
106  true,
107  in_array("text/html", iterator_to_array($this->getTypeManager()->getOtherMimeTypes()))
108  );
109  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testGetOtherSuffixes()

MediaTypeManagerTest::testGetOtherSuffixes ( )

Definition at line 71 of file MediaTypeManagerTest.php.

References getTypeManager().

71  : void
72  {
73  $this->assertEquals(
74  true,
75  in_array("html", iterator_to_array($this->getTypeManager()->getOtherSuffixes()))
76  );
77  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testGetVideoMimeTypes()

MediaTypeManagerTest::testGetVideoMimeTypes ( )

Definition at line 87 of file MediaTypeManagerTest.php.

References getTypeManager().

87  : void
88  {
89  $this->assertEquals(
90  true,
91  in_array("video/mp4", iterator_to_array($this->getTypeManager()->getVideoMimeTypes()))
92  );
93  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testGetVideoSuffixes()

MediaTypeManagerTest::testGetVideoSuffixes ( )

Definition at line 55 of file MediaTypeManagerTest.php.

References getTypeManager().

55  : void
56  {
57  $this->assertEquals(
58  ["mp4", "webm"],
59  iterator_to_array($this->getTypeManager()->getVideoSuffixes())
60  );
61  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testIsAudio()

MediaTypeManagerTest::testIsAudio ( )

Definition at line 39 of file MediaTypeManagerTest.php.

References getTypeManager().

39  : void
40  {
41  $this->assertEquals(
42  true,
43  $this->getTypeManager()->isAudio("audio/mpeg")
44  );
45  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testIsHtmlAllowed()

MediaTypeManagerTest::testIsHtmlAllowed ( )

Definition at line 143 of file MediaTypeManagerTest.php.

References getTypeManager().

143  : void
144  {
145  $tm = $this->getTypeManager([""]);
146  $this->assertEquals(
147  true,
148  $tm->isHtmlAllowed()
149  );
150  $tm = $this->getTypeManager(["text/html"]);
151  $this->assertEquals(
152  false,
153  $tm->isHtmlAllowed()
154  );
155  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testIsImage()

MediaTypeManagerTest::testIsImage ( )

Definition at line 23 of file MediaTypeManagerTest.php.

References getTypeManager().

23  : void
24  {
25  $this->assertEquals(
26  true,
27  $this->getTypeManager()->isImage("image/png")
28  );
29  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testIsVideo()

MediaTypeManagerTest::testIsVideo ( )

Definition at line 31 of file MediaTypeManagerTest.php.

References getTypeManager().

31  : void
32  {
33  $this->assertEquals(
34  true,
35  $this->getTypeManager()->isVideo("video/webm")
36  );
37  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

Field Documentation

◆ $types

ILIAS MediaObjects MediaType MediaTypeManager MediaTypeManagerTest::$types
protected

Definition at line 7 of file MediaTypeManagerTest.php.


The documentation for this class was generated from the following file: