ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 21 of file MediaTypeManagerTest.php.

Member Function Documentation

◆ getTypeManager()

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

◆ setUp()

MediaTypeManagerTest::setUp ( )
protected

Definition at line 25 of file MediaTypeManagerTest.php.

25  : void
26  {
27  parent::setUp();
28  }

◆ tearDown()

MediaTypeManagerTest::tearDown ( )
protected

Definition at line 30 of file MediaTypeManagerTest.php.

30  : void
31  {
32  }

◆ testGetAllowedVideoMimeTypes()

MediaTypeManagerTest::testGetAllowedVideoMimeTypes ( )

Definition at line 127 of file MediaTypeManagerTest.php.

References getTypeManager().

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

◆ testGetAllowedVideoSuffixes()

MediaTypeManagerTest::testGetAllowedVideoSuffixes ( )

Definition at line 141 of file MediaTypeManagerTest.php.

References getTypeManager().

141  : void
142  {
143  $tm = $this->getTypeManager(["video/webm"]);
144 
145  $this->assertEquals(
146  true,
147  in_array("mp4", iterator_to_array($tm->getAllowedVideoSuffixes()), true)
148  );
149  $this->assertEquals(
150  false,
151  in_array("webm", iterator_to_array($tm->getAllowedVideoSuffixes()), true)
152  );
153  $this->assertEquals(
154  false,
155  in_array("png", iterator_to_array($tm->getAllowedVideoSuffixes()), true)
156  );
157  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testGetAudioMimeTypes()

MediaTypeManagerTest::testGetAudioMimeTypes ( )

Definition at line 95 of file MediaTypeManagerTest.php.

References getTypeManager().

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

◆ testGetAudioSuffixes()

MediaTypeManagerTest::testGetAudioSuffixes ( )

Definition at line 63 of file MediaTypeManagerTest.php.

References getTypeManager().

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

◆ testGetImageMimeTypes()

MediaTypeManagerTest::testGetImageMimeTypes ( )

Definition at line 111 of file MediaTypeManagerTest.php.

References getTypeManager().

111  : void
112  {
113  $this->assertEquals(
114  true,
115  in_array("image/jpeg", iterator_to_array($this->getTypeManager()->getImageMimeTypes()))
116  );
117  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testGetImageSuffixes()

MediaTypeManagerTest::testGetImageSuffixes ( )

Definition at line 79 of file MediaTypeManagerTest.php.

References getTypeManager().

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

◆ testGetOtherMimeTypes()

MediaTypeManagerTest::testGetOtherMimeTypes ( )

Definition at line 119 of file MediaTypeManagerTest.php.

References getTypeManager().

119  : void
120  {
121  $this->assertEquals(
122  true,
123  in_array("text/html", iterator_to_array($this->getTypeManager()->getOtherMimeTypes()))
124  );
125  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testGetOtherSuffixes()

MediaTypeManagerTest::testGetOtherSuffixes ( )

Definition at line 87 of file MediaTypeManagerTest.php.

References getTypeManager().

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

◆ testGetVideoMimeTypes()

MediaTypeManagerTest::testGetVideoMimeTypes ( )

Definition at line 103 of file MediaTypeManagerTest.php.

References getTypeManager().

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

◆ testGetVideoSuffixes()

MediaTypeManagerTest::testGetVideoSuffixes ( )

Definition at line 71 of file MediaTypeManagerTest.php.

References getTypeManager().

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

◆ testIsAudio()

MediaTypeManagerTest::testIsAudio ( )

Definition at line 55 of file MediaTypeManagerTest.php.

References getTypeManager().

55  : void
56  {
57  $this->assertEquals(
58  true,
59  $this->getTypeManager()->isAudio("audio/mpeg")
60  );
61  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testIsHtmlAllowed()

MediaTypeManagerTest::testIsHtmlAllowed ( )

Definition at line 159 of file MediaTypeManagerTest.php.

References getTypeManager().

159  : void
160  {
161  $tm = $this->getTypeManager([""]);
162  $this->assertEquals(
163  true,
164  $tm->isHtmlAllowed()
165  );
166  $tm = $this->getTypeManager(["text/html"]);
167  $this->assertEquals(
168  false,
169  $tm->isHtmlAllowed()
170  );
171  }
getTypeManager(array $mime_blacklist=[])
+ Here is the call graph for this function:

◆ testIsImage()

MediaTypeManagerTest::testIsImage ( )

Definition at line 39 of file MediaTypeManagerTest.php.

References getTypeManager().

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

◆ testIsVideo()

MediaTypeManagerTest::testIsVideo ( )

Definition at line 47 of file MediaTypeManagerTest.php.

References getTypeManager().

47  : void
48  {
49  $this->assertEquals(
50  true,
51  $this->getTypeManager()->isVideo("video/webm")
52  );
53  }
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 23 of file MediaTypeManagerTest.php.


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