Debian Codegraph @

tests/phpunit/unit/includes/Settings/SettingsBuilderTest.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Tests\Unit\Settings;
4
5 use InvalidArgumentException;
6 use MediaWiki\MainConfigNames;
7 use MediaWiki\MainConfigSchema;
8 use MediaWiki\Registration\ExtensionRegistry;
9 use MediaWiki\Settings\Cache\CacheableSource;
10 use MediaWiki\Settings\Cache\CachedSource;
11 use MediaWiki\Settings\Config\ArrayConfigBuilder;
12 use MediaWiki\Settings\Config\MergeStrategy;
13 use MediaWiki\Settings\Config\PhpIniSink;
14 use MediaWiki\Settings\SettingsBuilder;
15 use MediaWiki\Settings\SettingsBuilderException;
16 use PHPUnit\Framework\TestCase;
17 use Wikimedia\ObjectCache\BagOStuff;
18
19 /**
20 * @covers \MediaWiki\Settings\SettingsBuilder
21 */
22 class SettingsBuilderTest extends TestCase {
23
24 /**
25 * @param array $params
26 * @return SettingsBuilder
27 */
28 private function newSettingsBuilder( $params = [] ): SettingsBuilder {
29 return new SettingsBuilder(
30 __DIR__,
31 $params['extensionRegistry'] ?? $this->createMock( ExtensionRegistry::class ),
32 $params['configBuilder'] ?? new ArrayConfigBuilder(),
33 $params['phpIniSink'] ?? $this->createMock( PhpIniSink::class ),
34 $params['cache'] ?? null
35 );
36 }
37
38 public function testLoadingFromFile() {
39 $phpIniSinkMock = $this->createMock( PhpIniSink::class );
40 $phpIniSinkMock->expects( $this->once() )->method( 'set' )->with( 'foo', 'bar' );
41
42 $setting = $this->newSettingsBuilder( [
43 'phpIniSink' => $phpIniSinkMock
44 ] );
45 $setting->loadFile( 'fixtures/settings.json' )->apply();
46
47 $config = $setting->getConfig();
48 $this->assertSame( 'TEST', $config->get( 'Something' ) );
49 }
50
51 public function testLoadingIncludesRecursiveFromFile() {
52 $configBuilder = new ArrayConfigBuilder();
53
54 $phpIniSinkMock = $this->createMock( PhpIniSink::class );
55 $phpIniSinkMock->expects( $this->once() )->method( 'set' )->with( 'foo', 'bar' );
56
57 // Make sure the cache is hit twice, once for each file!
58 $mockCache = $this->createMock( BagOStuff::class );
59 $key = 'foo';
60
61 $mockCache
62 ->expects( $this->atLeastOnce() )
63 ->method( 'makeGlobalKey' )
64 ->willReturn( $key );
65
66 $mockCache
67 ->expects( $this->exactly( 2 ) )
68 ->method( 'get' )
69 ->willReturn( false );
70
71 $mockCache
72 ->expects( $this->exactly( 2 ) )
73 ->method( 'lock' )
74 ->willReturn( true );
75
76 $mockCache
77 ->expects( $this->exactly( 2 ) )
78 ->method( 'unlock' )
79 ->willReturn( true );
80
81 $setting = $this->newSettingsBuilder( [
82 'configBuilder' => $configBuilder,
83 'phpIniSink' => $phpIniSinkMock,
84 'cache' => $mockCache,
85 ] );
86 $setting->loadFile( 'fixtures/settings-with-includes.json' )->apply();
87
88 $config = $configBuilder->build();
89 $this->assertSame( 'TEST', $config->get( 'Something' ) );
90 }
91
92 /**
93 * Ensure that includes work in a source that is not a SettingsIncludeLocator
94 */
95 public function testLoadingIncludesRecursiveFromArray() {
96 $configBuilder = new ArrayConfigBuilder();
97
98 $phpIniSinkMock = $this->createMock( PhpIniSink::class );
99 $phpIniSinkMock->expects( $this->once() )->method( 'set' )->with( 'foo', 'bar' );
100
101 $setting = $this->newSettingsBuilder( [
102 'configBuilder' => $configBuilder,
103 'phpIniSink' => $phpIniSinkMock,
104 ] );
105 $setting->loadArray( [ 'includes' => [ 'fixtures/settings.json' ] ] )->apply();
106
107 $config = $configBuilder->build();
108 $this->assertSame( 'TEST', $config->get( 'Something' ) );
109 }
110
111 public function testLoadingIncludesRecursiveLoop() {
112 $setting = $this->newSettingsBuilder();
113
114 $this->expectException( SettingsBuilderException::class );
115 $setting->loadFile( 'fixtures/settings-with-self-includes.json' )->apply();
116 }
117
118 public function testLoadingAndApplyingFromFileAfterFinalize() {
119 $configBuilder = new ArrayConfigBuilder();
120
121 $phpIniSinkMock = $this->createMock( PhpIniSink::class );
122 $phpIniSinkMock->expects( $this->once() )->method( 'set' )->with( 'foo', 'bar' );
123
124 $setting = $this->newSettingsBuilder( [
125 'configBuilder' => $configBuilder,
126 'phpIniSink' => $phpIniSinkMock
127 ] );
128 $setting->loadFile( 'fixtures/settings.json' )->apply();
129
130 $config = $configBuilder->build();
131 $this->assertSame( 'TEST', $config->get( 'Something' ) );
132
133 // Check that after enterRegistrationStage(), we can still override config,
134 // but we can't load settings sources.
135 $setting->enterRegistrationStage();
136 $setting->overrideConfigValue( 'Foo', 'bar' );
137
138 $this->expectException( SettingsBuilderException::class );
139 $setting->loadFile( 'fixtures/settings.json' )->apply();
140 }
141
142 public function testSettingConfigAfterLock() {
143 $setting = $this->newSettingsBuilder();
144
145 // Check that after enterOperationStage(), we can't override config.
146 $setting->enterReadOnlyStage();
147
148 $this->expectException( SettingsBuilderException::class );
149 $setting->overrideConfigValue( 'Foo', 'bar' );
150 }
151
152 public function testLoadingExtensions() {
153 $extensionRegistryMock = $this->createMock( ExtensionRegistry::class );
154 $expectedQueuePaths = [
155 '/test/extensions/Foo/extension.json',
156 '/test/extensions/Bar/extension.json',
157 '/test/skins/Quux/skin.json',
158 ];
159 $extensionRegistryMock
160 ->expects( $this->exactly( 3 ) )
161 ->method( 'queue' )
162 ->willReturnCallback( function ( $path ) use ( &$expectedQueuePaths ) {
163 $this->assertContains( $path, $expectedQueuePaths );
164 $pathIdx = array_search( $path, $expectedQueuePaths, true );
165 unset( $expectedQueuePaths[$pathIdx] );
166 } );
167
168 $setting = $this->newSettingsBuilder( [
169 'extensionRegistry' => $extensionRegistryMock,
170 ] );
171 $setting->loadFile( 'fixtures/default-schema.json' );
172 $setting->loadFile( 'fixtures/settings.json' );
173 $setting->apply();
174 }
175
176 public static function provideConfigDefaults() {
177 yield 'sets a value from a single settings file' => [
178 'settingsBatches' => [
179 [ 'config' => [ 'MySetting' => 'MyValue', ], ],
180 ],
181 'expected' => [
182 'MySetting' => 'MyValue',
183 ],
184 ];
185 yield 'merges different values from multiple settings files' => [
186 'settingsBatches' => [
187 [ 'config' => [ 'MySetting' => 'MyValue', ], ],
188 [ 'config' => [ 'MyOtherSetting' => 'MyOtherValue', ], ],
189 ],
190 'expected' => [
191 'MySetting' => 'MyValue',
192 'MyOtherSetting' => 'MyOtherValue',
193 ],
194 ];
195 yield 'overrides value in config' => [
196 'settingsBatches' => [
197 [ 'config' => [ 'MySetting' => 'MyValue', ], ],
198 [ 'config' => [ 'MySetting' => 'MyOtherValue', ], ],
199 ],
200 'expected' => [
201 'MySetting' => 'MyOtherValue',
202 ],
203 ];
204 yield 'sets a default from schema' => [
205 'settingsBatches' => [
206 [ 'config-schema' => [ 'MySetting' => [ 'default' => 'MyDefault', ], ], ],
207 ],
208 'expected' => [
209 'MySetting' => 'MyDefault',
210 ],
211 ];
212 yield 'value in config overrides default from schema' => [
213 'settingsBatches' => [
214 [
215 'config-schema' => [ 'MySetting' => [ 'default' => 'MyDefault', ], ],
216 'config' => [ 'MySetting' => 'MyValue', ],
217 ],
218 ],
219 'expected' => [
220 'MySetting' => 'MyValue',
221 ],
222 ];
223 yield 'default null is applied' => [
224 'settingsBatches' => [
225 [ 'config-schema' => [ 'MySetting' => [ 'default' => null, ], ], ],
226 ],
227 'expected' => [
228 'MySetting' => null,
229 ],
230 ];
231 yield 'null value can override default' => [
232 'settingsBatches' => [
233 [
234 'config-schema' => [ 'MySetting' => [ 'default' => 'default', ], ],
235 'config' => [ 'MySetting' => null, ],
236 ],
237 ],
238 'expected' => [
239 'MySetting' => null,
240 ],
241 ];
242 yield 'merge strategy is applied when setting config' => [
243 'settingsBatches' => [
244 [
245 'config-schema' => [ 'MySetting' => [
246 'mergeStrategy' => MergeStrategy::ARRAY_MERGE_RECURSIVE
247 ], ],
248 'config' => [ 'MySetting' => [ 'a' => [ 'b' => 'c' ], ], ],
249 ],
250 [
251 'config' => [ 'MySetting' => [ 'a' => [ 'b' => 'd' ], ], ],
252 ]
253 ],
254 'expected' => [
255 'MySetting' => [ 'a' => [ 'b' => [ 'c', 'd' ], ], ],
256 ],
257 ];
258 yield 'merge strategy is ignored when using config-overrides' => [
259 'settingsBatches' => [
260 [
261 'config-schema' => [ 'MySetting' => [
262 'mergeStrategy' => MergeStrategy::ARRAY_MERGE_RECURSIVE
263 ], ],
264 'config-overrides' => [ 'MySetting' => [ 'a' => [ 'b' => 'c' ], ], ],
265 ],
266 [
267 'config-overrides' => [ 'MySetting' => [ 'a' => [ 'b' => 'd' ], ], ],
268 ]
269 ],
270 'expected' => [
271 'MySetting' => [ 'a' => [ 'b' => 'd' ], ],
272 ],
273 ];
274 yield 'config value is merged into default when setting both in the same settings file' => [
275 'settingsBatches' => [
276 [
277 'config' => [ 'MySetting' => [ 'a' => [ 'b' => 'd' ], ], ],
278 'config-schema' => [ 'MySetting' => [
279 'mergeStrategy' => MergeStrategy::ARRAY_MERGE_RECURSIVE,
280 'default' => [ 'a' => [ 'b' => 'c' ], ],
281 ], ],
282 ]
283 ],
284 'expected' => [
285 'MySetting' => [ 'a' => [ 'b' => [ 'c', 'd' ], ], ],
286 ],
287 ];
288 yield 'default is merged backwards into config value when set later' => [
289 'settingsBatches' => [
290 [
291 'config' => [ 'MySetting' => [ 'a' => [ 'b' => 'd' ], ], ],
292 ],
293 [
294 'config-schema' => [ 'MySetting' => [
295 'mergeStrategy' => MergeStrategy::ARRAY_MERGE_RECURSIVE,
296 'default' => [ 'a' => [ 'b' => 'c' ], ],
297 ], ],
298 ]
299 ],
300 'expected' => [
301 'MySetting' => [ 'a' => [ 'b' => [ 'c', 'd' ], ], ],
302 ],
303 ];
304 }
305
306 /**
307 * @dataProvider provideConfigDefaults
308 */
309 public function testConfigDefaults( array $settingsBatches, array $expected ) {
310 $configBuilder = new ArrayConfigBuilder();
311 $setting = $this->newSettingsBuilder( [ 'configBuilder' => $configBuilder ] );
312 foreach ( $settingsBatches as $batch ) {
313 $setting->loadArray( $batch );
314 }
315 $setting->apply();
316 foreach ( $expected as $key => $value ) {
317 $this->assertSame( $value, $configBuilder->build()->get( $key ) );
318 }
319 }
320
321 public function testSetConfig() {
322 $setting = $this->newSettingsBuilder();
323
324 $setting->loadArray( [
325 'config-schema' => [
326 'a' => [ 'mergeStrategy' => MergeStrategy::ARRAY_MERGE ]
327 ]
328 ] );
329
330 $setting->putConfigValues( [ 'a' => [ 1 ], 'b' => 2 ] );
331
332 $config = $setting->getConfig();
333 $this->assertSame( [ 1 ], $config->get( 'a' ) );
334 $this->assertSame( 2, $config->get( 'b' ) );
335
336 $setting->putConfigValues( [ 'a' => [ 11 ], 'b' => 22 ] );
337
338 $config = $setting->getConfig();
339 $this->assertSame( [ 1, 11 ], $config->get( 'a' ) );
340 $this->assertSame( 22, $config->get( 'b' ) );
341
342 $setting->putConfigValue( 'a', [ 111 ] );
343
344 $config = $setting->getConfig();
345 $this->assertSame( [ 1, 11, 111 ], $config->get( 'a' ) );
346 $this->assertSame( 22, $config->get( 'b' ) );
347 }
348
349 public function testOverrideConfig() {
350 $setting = $this->newSettingsBuilder();
351
352 $setting->loadArray( [
353 'config-schema' => [
354 'a' => [ 'mergeStrategy' => MergeStrategy::ARRAY_MERGE ]
355 ]
356 ] );
357
358 $setting->overrideConfigValues( [ 'a' => [ 1 ], 'b' => 2 ] );
359
360 $config = $setting->getConfig();
361 $this->assertSame( [ 1 ], $config->get( 'a' ) );
362 $this->assertSame( 2, $config->get( 'b' ) );
363
364 $setting->overrideConfigValues( [ 'a' => [ 11 ], 'b' => 22 ] );
365
366 $config = $setting->getConfig();
367 $this->assertSame( [ 11 ], $config->get( 'a' ) );
368 $this->assertSame( 22, $config->get( 'b' ) );
369
370 $setting->overrideConfigValue( 'a', [ 111 ] );
371
372 $config = $setting->getConfig();
373 $this->assertSame( [ 111 ], $config->get( 'a' ) );
374 $this->assertSame( 22, $config->get( 'b' ) );
375 }
376
377 public function testRegisterHookHandler() {
378 $setting = $this->newSettingsBuilder();
379
380 $hookName = 'TestHookForSettingsBuilderTest';
381 $setting->registerHookHandlers( [ $hookName => [ 'strtolower' ] ] );
382
383 $config = $setting->getConfig();
384 $this->assertArrayHasKey( $hookName, $config->get( MainConfigNames::Hooks ) );
385 }
386
387 public function testApplyPurgesState() {
388 $configBuilder = new ArrayConfigBuilder();
389 $setting = $this->newSettingsBuilder( [ 'configBuilder' => $configBuilder ] );
390 $setting->putConfigValue( 'MySetting', 'MyValue' )
391 ->apply();
392 $this->assertSame( 'MyValue', $configBuilder->build()->get( 'MySetting' ) );
393 $configBuilder->set( 'MySetting', 'MyOtherValue' );
394 // Calling apply a second time should not redefine the global
395 // since the state should be cleared
396 $setting->apply();
397 $this->assertSame( 'MyOtherValue', $configBuilder->build()->get( 'MySetting' ) );
398 }
399
400 public function testApplyDefaultDoesNotOverwriteExisting() {
401 $configBuilder = new ArrayConfigBuilder();
402
403 // If we set a value via SettingsBuilder, defining a default later
404 // should not override it.
405 $this->newSettingsBuilder( [ 'configBuilder' => $configBuilder ] )
406 ->putConfigValue( 'MySetting', 'existing' )
407 ->loadArray( [ 'config-schema' => [ 'MySetting' => [ 'default' => 'default' ], ], ] )
408 ->apply();
409
410 $this->assertSame( 'existing', $configBuilder->build()->get( 'MySetting' ) );
411 }
412
413 public function testApplyDefaultDoesNotOverwritePreexisting() {
414 $configBuilder = new ArrayConfigBuilder();
415
416 // If we set a value in the config directly, defining a default later
417 // would override it, unless we call assumeDirtyConfig().
418 $configBuilder->set( 'MySetting', 'existing' );
419
420 $this->newSettingsBuilder( [ 'configBuilder' => $configBuilder ] )
421 ->assumeDirtyConfig()
422 ->loadArray( [ 'config-schema' => [ 'MySetting' => [ 'default' => 'default' ], ], ] )
423 ->apply();
424 $this->assertSame( 'existing', $configBuilder->build()->get( 'MySetting' ) );
425 }
426
427 public function testConfigSchemaOverrideNotAllowed() {
428 $this->expectException( SettingsBuilderException::class );
429 $this->newSettingsBuilder()
430 ->loadArray( [ 'config-schema' => [ 'MySetting' => [ 'default' => 'default' ], ], ] )
431 ->loadArray( [ 'config-schema' => [ 'MySetting' => [ 'default' => 'override' ], ], ] )
432 ->apply();
433 }
434
435 public function testConfigSchemaDefaultsEvaluation() {
436 $settingsBuilder = $this->newSettingsBuilder();
437 $settingsBuilder->loadArray( [
438 'config-schema' => [
439 'A' => [ 'default' => [ 'a' ], 'type' => 'array' ],
440 'B' => [ 'default' => [ 'b' ], 'type' => 'array' ],
441 ],
442 'config' => [
443 'B' => [ 'b2' ],
444 'C' => [ 'c2' ],
445 ]
446 ] );
447 $settingsBuilder->loadArray( [
448 'config-schema' => [
449 'X' => [ 'default' => [ 'x' ], 'type' => 'array' ],
450 ],
451 'config' => [
452 'A' => [ 'a3' ],
453 'B' => [ 'b3' ],
454 ],
455 'config-overrides' => [
456 'C' => [ 'c4' ],
457 ]
458 ] );
459
460 $config = $settingsBuilder->getConfig();
461 $this->assertSame( [ 'a', 'a3' ], $config->get( 'A' ) );
462 $this->assertSame( [ 'b', 'b2', 'b3' ], $config->get( 'B' ) );
463 $this->assertSame( [ 'c4' ], $config->get( 'C' ) );
464 $this->assertSame( [ 'x' ], $config->get( 'X' ) );
465 }
466
467 public static function provideValidate() {
468 yield 'all good' => [
469 'settings' => [
470 'config-schema' => [ 'foo' => [ 'type' => 'string', ], ],
471 'config' => [ 'foo' => 'bar', ],
472 ],
473 'valid' => true,
474 ];
475 yield 'missing key' => [
476 'settings' => [
477 'config-schema' => [ 'foo' => [ 'type' => 'string', ], ],
478 'config' => [ 'bar' => 'bar' ],
479 ],
480 'valid' => false,
481 ];
482 yield 'invalid config' => [
483 'settings' => [
484 'config-schema' => [ 'foo' => [ 'type' => 'string', ], ],
485 'config' => [ 'foo' => 1 ],
486 ],
487 'valid' => false,
488 ];
489 yield 'no schema was added' => [
490 'settings' => [
491 'config-schema' => [],
492 'config' => [ 'foo' => 'bar', ],
493 ],
494 'valid' => true,
495 ];
496 yield 'key is in config but has no schema' => [
497 'settings' => [
498 'config-schema' => [ 'foo' => [ 'type' => 'array', 'mergeStrategy' => MergeStrategy::ARRAY_MERGE ], ],
499 'config' => [ 'foo' => [], 'baz' => false, ],
500 ],
501 'valid' => true,
502 ];
503 }
504
505 /**
506 * @dataProvider provideValidate
507 */
508 public function testValidate( array $settings, bool $valid ) {
509 $status = $this->newSettingsBuilder()
510 ->loadArray( $settings )
511 ->apply()
512 ->validate();
513 $this->assertSame( $valid, $status->isOK() );
514 }
515
516 public function testValidateInvalidSchema() {
517 $this->expectException( InvalidArgumentException::class );
518 $this->newSettingsBuilder()
519 ->loadArray( [
520 'config-schema' => [ 'foo' => [ 'type' => 1 ] ],
521 'config' => [ 'foo' => 'bar' ],
522 ] )
523 ->apply()
524 ->validate();
525 }
526
527 public function testLoadsCacheableSource() {
528 $mockSource = $this->createMock( CacheableSource::class );
529 $mockCache = $this->createMock( BagOStuff::class );
530 $configBuilder = new ArrayConfigBuilder();
531 $builder = $this
532 ->newSettingsBuilder( [
533 'configBuilder' => $configBuilder,
534 'cache' => $mockCache
535 ] )
536 ->load( $mockSource );
537
538 $hashKey = 'abc123';
539 $key = 'global:' . self::class . ':' . $hashKey;
540
541 // Mock a cache miss
542 $mockSource
543 ->expects( $this->once() )
544 ->method( 'getHashKey' )
545 ->willReturn( $hashKey );
546
547 $mockCache
548 ->expects( $this->once() )
549 ->method( 'makeGlobalKey' )
550 ->with( CachedSource::class, $hashKey )
551 ->willReturn( $key );
552
553 $mockCache
554 ->expects( $this->once() )
555 ->method( 'get' )
556 ->with( $key )
557 ->willReturn( false );
558
559 $mockCache
560 ->expects( $this->once() )
561 ->method( 'lock' )
562 ->willReturn( true );
563
564 $mockCache
565 ->expects( $this->once() )
566 ->method( 'unlock' )
567 ->willReturn( true );
568
569 $mockSource
570 ->expects( $this->once() )
571 ->method( 'load' )
572 ->willReturn( [ 'config' => [ 'MySetting' => 'BlaBla' ] ] );
573
574 $builder->apply();
575
576 $this->assertSame( 'BlaBla', $configBuilder->build()->get( 'MySetting' ) );
577 }
578
579 public function testGetDefaultConfig() {
580 $defaultConfig = $this->newSettingsBuilder()
581 ->loadArray( [ 'config-schema' => [
582 'MySetting' => [ 'default' => 'bla' ],
583 'OtherSetting' => [ 'type' => 'number' ], // no default
584 ] ] )
585 ->apply()
586 ->getDefaultConfig();
587
588 $this->assertTrue( $defaultConfig->has( 'MySetting' ) );
589 $this->assertSame( 'bla', $defaultConfig->get( 'MySetting' ) );
590
591 $this->assertTrue( $defaultConfig->has( 'OtherSetting' ) );
592 $this->assertNull( $defaultConfig->get( 'OtherSetting' ) );
593 }
594
595 public function testGetConfigSchema() {
596 $configSchema = $this->newSettingsBuilder()
597 ->loadArray( [ 'config-schema' => [ 'MySetting' => [ 'default' => 'bla' ], ], ] )
598 ->apply()
599 ->getConfigSchema();
600 $this->assertTrue( $configSchema->hasSchemaFor( 'MySetting' ) );
601 $this->assertSame( 'bla', $configSchema->getDefaultFor( 'MySetting' ) );
602 }
603
604 /**
605 * Make sure that the 'config-schema' and 'config-schema-inverse' keys
606 * are fully processed and combined appropriately.
607 */
608 public function testSchemaLoading() {
609 $settings = $this->newSettingsBuilder();
610 $settings->loadFile( 'fixtures/default-schema.json' );
611 $schema = $settings->getConfigSchema();
612
613 $this->assertSame(
614 '/DEFAULT/',
615 $schema->getDefaultFor( 'StyleDirectory' )
616 );
617 $this->assertSame(
618 [ 'callback' => [ MainConfigSchema::class, 'getDefaultUsePathInfo' ] ],
619 $schema->getDynamicDefaultDeclarationFor( 'UsePathInfo' )
620 );
621 $this->assertSame(
622 'replace',
623 $schema->getMergeStrategyFor( 'LBFactoryConf' )->getName()
624 );
625 $this->assertSame(
626 '/DEFAULT/',
627 $schema->getDefaultFor( 'ExtensionDirectory' )
628 );
629 $this->assertSame(
630 [ 'use' => [ 'ScriptPath' ], 'callback' => [ MainConfigSchema::class, 'getDefaultRestPath' ] ],
631 $schema->getDynamicDefaultDeclarationFor( 'RestPath' )
632 );
633 $this->assertSame(
634 [ 'use' => [ 'ScriptPath' ], 'callback' => [ MainConfigSchema::class, 'getDefaultRestPath' ] ],
635 $schema->getDynamicDefaultDeclarationFor( 'RestPath' )
636 );
637 $this->assertSame(
638 'replace',
639 $schema->getMergeStrategyFor( 'TiffThumbnailType' )->getName()
640 );
641 }
642
643 }