Hoa central
Public Member Functions | List of all members
Hoa\Mime\Test\Unit\Documentation Class Reference
Inheritance diagram for Hoa\Mime\Test\Unit\Documentation:

Public Member Functions

 case_getExtensionsFromMime_text_html ()
 
 case_getMimeFromExtension_webm ()
 
 case_stream ()
 
- Public Member Functions inherited from Hoa\Test\Unit\Suite
 __construct ()
 
 getTestedClassName ()
 
 getTestedClassNamespace ()
 
 beforeTestMethod ($methodName)
 

Detailed Description

Class .

Test suite of the examples in the documentation.

Definition at line 51 of file Documentation.php.

Member Function Documentation

Hoa\Mime\Test\Unit\Documentation::case_getExtensionsFromMime_text_html ( )

Definition at line 53 of file Documentation.php.

54  {
55  $this
56  ->given($mime = 'text/html')
57  ->when($extensions = LUT::getExtensionsFromMime($mime))
58  ->then
59  ->array($extensions)
60  ->isEqualTo([
61  0 => 'html',
62  1 => 'htm'
63  ]);
64  }
Hoa\Mime\Test\Unit\Documentation::case_getMimeFromExtension_webm ( )

Definition at line 66 of file Documentation.php.

67  {
68  $this
69  ->given($extension = 'webm')
70  ->when($mime = LUT::getMimeFromExtension($extension))
71  ->then
72  ->string($mime)
73  ->isEqualTo('video/webm');
74  }
Hoa\Mime\Test\Unit\Documentation::case_stream ( )

Definition at line 76 of file Documentation.php.

77  {
78  $this
79  ->given($file = 'hoa://Test/Vfs/index.html')
80  ->when($type = new LUT(new File\Read($file)))
81  ->then
82  ->string($type->getExtension())
83  ->isEqualTo('html')
84  ->array($type->getOtherExtensions())
85  ->isEqualTo([
86  0 => 'htm'
87  ])
88  ->string($type->getMime())
89  ->isEqualTo('text/html')
90  ->boolean($type->isExperimental())
91  ->isFalse();
92  }

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