@@ -47,8 +47,10 @@ public function testAdd(): void
4747 {
4848 // Adding a new type with a new extension.
4949 $ this ->map ->addTypeExtensionMapping ('bingo/bongo ' , 'bngbng ' );
50+ $ this ->map ->addTypeDescription ('bingo/bongo ' , 'Bingo, Bongo! ' );
5051 $ this ->assertSame (['bngbng ' ], (new Type ('bingo/bongo ' ))->getExtensions ());
5152 $ this ->assertSame ('bngbng ' , (new Type ('bingo/bongo ' ))->getDefaultExtension ());
53+ $ this ->assertSame ('Bingo, Bongo! ' , (new Type ('bingo/bongo ' ))->getDescription ());
5254 $ this ->assertSame (['bingo/bongo ' ], (new Extension ('bngbng ' ))->getTypes ());
5355 $ this ->assertSame ('bingo/bongo ' , (new Extension ('bngbng ' ))->getDefaultType ());
5456
@@ -200,6 +202,14 @@ public function testSetExtensionDefaultType(): void
200202 $ this ->assertSame (['image/vnd.dvb.subtitle ' , 'text/vnd.dvb.subtitle ' , 'text/x-microdvd ' , 'text/x-mpsub ' , 'text/x-subviewer ' ], (new Extension ('SUB ' ))->getTypes ());
201203 }
202204
205+ public function testAddAliasToType (): void
206+ {
207+ $ this ->assertSame (['image/psd ' , 'image/x-psd ' , 'image/photoshop ' , 'image/x-photoshop ' , 'application/photoshop ' , 'application/x-photoshop ' ,], (new Type ('image/vnd.adobe.photoshop ' ))->getAliases ());
208+ $ this ->map ->addTypeAlias ('image/vnd.adobe.photoshop ' , 'application/x-foo-bar ' );
209+ $ this ->assertSame (['image/psd ' , 'image/x-psd ' , 'image/photoshop ' , 'image/x-photoshop ' , 'application/photoshop ' , 'application/x-photoshop ' , 'application/x-foo-bar ' ,], (new Type ('image/vnd.adobe.photoshop ' ))->getAliases ());
210+ $ this ->assertContains ('application/x-foo-bar ' , $ this ->map ->listAliases ());
211+ }
212+
203213 public function testReAddAliasToType (): void
204214 {
205215 $ this ->assertSame (['image/psd ' , 'image/x-psd ' , 'image/photoshop ' , 'image/x-photoshop ' , 'application/photoshop ' , 'application/x-photoshop ' ,], (new Type ('image/vnd.adobe.photoshop ' ))->getAliases ());
0 commit comments