13 protected function setUp() {
16 $this->filePath = __DIR__ .
'/../../data/media';
18 'name' =>
'localtesting',
19 'wikiId' => wfWikiId(),
20 'containerPaths' =>
array(
'data' => $this->filePath )
24 'url' =>
'http://localhost/thumbtest',
25 'backend' => $this->backend
34 $res = $this->handler->getMetadata(
null, $this->filePath .
'/README' );
46 $actual = $this->handler->isAnimatedImage(
$file );
47 $this->assertEquals( $expected, $actual );
52 array(
'Animated_PNG_example_bouncing_beach_ball.png',
true ),
53 array(
'1bit-png.png',
false ),
65 $actual = $this->handler->getImageArea(
$file,
$file->getWidth(),
$file->getHeight() );
66 $this->assertEquals( $expected, $actual );
71 array(
'1bit-png.png', 2500 ),
72 array(
'greyscale-png.png', 2500 ),
73 array(
'Png-native-test.png', 126000 ),
74 array(
'Animated_PNG_example_bouncing_beach_ball.png', 10000 ),
85 $actual = $this->handler->isMetadataValid(
null, $metadata );
86 $this->assertEquals( $expected, $actual );
95 array(
'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}',
PNGHandler::METADATA_GOOD ),
107 $actual = $this->handler->getMetadata(
$file,
"$this->filePath/$filename" );
109 $this->assertEquals( ( $expected ), ( $actual ) );
114 array(
'rgb-na-png.png',
'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}' ),
115 array(
'xmp.png',
'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:1;s:9:"colorType";s:14:"index-coloured";s:8:"metadata";a:2:{s:12:"SerialNumber";s:9:"123456789";s:15:"_MW_PNG_VERSION";i:1;}}' ),
127 $actual = $this->handler->getCommonMetaArray(
$file );
128 $this->assertEquals( $expected, $actual );
136 'SerialNumber' =>
'123456789',
144 "mwstore://localtesting/data/$name",
$type );