@@ -47,8 +47,10 @@ public function testAdd(): void
47
47
{
48
48
// Adding a new type with a new extension.
49
49
$ this ->map ->addTypeExtensionMapping ('bingo/bongo ' , 'bngbng ' );
50
+ $ this ->map ->addTypeDescription ('bingo/bongo ' , 'Bingo, Bongo! ' );
50
51
$ this ->assertSame (['bngbng ' ], (new Type ('bingo/bongo ' ))->getExtensions ());
51
52
$ this ->assertSame ('bngbng ' , (new Type ('bingo/bongo ' ))->getDefaultExtension ());
53
+ $ this ->assertSame ('Bingo, Bongo! ' , (new Type ('bingo/bongo ' ))->getDescription ());
52
54
$ this ->assertSame (['bingo/bongo ' ], (new Extension ('bngbng ' ))->getTypes ());
53
55
$ this ->assertSame ('bingo/bongo ' , (new Extension ('bngbng ' ))->getDefaultType ());
54
56
@@ -200,6 +202,14 @@ public function testSetExtensionDefaultType(): void
200
202
$ this ->assertSame (['image/vnd.dvb.subtitle ' , 'text/vnd.dvb.subtitle ' , 'text/x-microdvd ' , 'text/x-mpsub ' , 'text/x-subviewer ' ], (new Extension ('SUB ' ))->getTypes ());
201
203
}
202
204
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
+
203
213
public function testReAddAliasToType (): void
204
214
{
205
215
$ 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