);
$this->assertEquals(
' step=any',
- Html::expandAttributes( array(
- 'min' => 1,
- 'max' => 100,
- 'pattern' => 'abc',
- 'required' => true,
- 'step' => 'any'
- ) ,
- 'Allow special case "step=any".'
- ) );
+ Html::expandAttributes(
+ array(
+ 'min' => 1,
+ 'max' => 100,
+ 'pattern' => 'abc',
+ 'required' => true,
+ 'step' => 'any'
+ ),
+ 'Allow special case "step=any".'
+ )
+ );
}
}
'<label for="year">From year (and earlier):</label> ' .
'<input id="year" maxlength="4" size="7" type="number" name="year" /> ' .
'<label for="month">From month (and earlier):</label> ' .
- '<select id="month" name="month" class="mw-month-selector"><option value="-1">all</option>' . "\n" .
+ '<select id="month" name="month" class="mw-month-selector">' .
+ '<option value="-1">all</option>' . "\n" .
'<option value="1">January</option>' . "\n" .
'<option value="2">February</option>' . "\n" .
'<option value="3">March</option>' . "\n" .
$resultOffset = 0;
// Open the file:
wfSuppressWarnings();
- $handle = @fopen( $filePath, "r" );
+ $handle = fopen( $filePath, "r" );
wfRestoreWarnings();
if ( $handle === false ) {
public function testValidateCallsUserDefinedValidationCallback() {
$called = false;
$field = new HTMLCheckMatrix( self::$defaultOptions + array(
- 'validation-callback' => function () use ( &$called ) {
- $called = true;
+ 'validation-callback' => function () use ( &$called ) {
+ $called = true;
- return false;
- },
- ) );
+ return false;
+ },
+ ) );
$this->assertEquals( false, $this->validate( $field, array() ) );
$this->assertTrue( $called );
}
!$this->checkIfToolExists( $wgDjvuDump ) ||
!$this->checkIfToolExists( $wgDjvuToXML )
) {
- $this->markTestSkipped( 'This test needs the installation of the ddjvu, djvutoxml and djvudump tools' );
+ $this->markTestSkipped( 'This test needs the installation of the '
+ . 'ddjvu, djvutoxml and djvudump tools' );
}
//file repo setup
* @covers ExifBitmapHandler::isMetadataValid
*/
public function testGoodMetadata() {
+ // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
$meta = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}';
+ // @codingStandardsIgnoreEnd
$res = $this->handler->isMetadataValid( null, $meta );
$this->assertEquals( ExifBitmapHandler::METADATA_GOOD, $res );
}
* @covers ExifBitmapHandler::isMetadataValid
*/
public function testIsOldGood() {
+ // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
$meta = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}';
+ // @codingStandardsIgnoreEnd
$res = $this->handler->isMetadataValid( null, $meta );
$this->assertEquals( ExifBitmapHandler::METADATA_COMPATIBLE, $res );
}
* @covers ExifBitmapHandler::isMetadataValid
*/
public function testPagedTiffHandledGracefully() {
+ // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
$meta = 'a:6:{s:9:"page_data";a:1:{i:1;a:5:{s:5:"width";i:643;s:6:"height";i:448;s:5:"alpha";s:4:"true";s:4:"page";i:1;s:6:"pixels";i:288064;}}s:10:"page_count";i:1;s:10:"first_page";i:1;s:9:"last_page";i:1;s:4:"exif";a:9:{s:10:"ImageWidth";i:643;s:11:"ImageLength";i:448;s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:4;s:12:"RowsPerStrip";i:50;s:19:"PlanarConfiguration";i:1;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}s:21:"TIFF_METADATA_VERSION";s:3:"1.4";}';
+ // @codingStandardsIgnoreEnd
$res = $this->handler->isMetadataValid( null, $meta );
$this->assertEquals( ExifBitmapHandler::METADATA_BAD, $res );
}
$file = $this->dataFile( $name, $type );
$thumb = $file->transform( $params, File::RENDER_NOW | File::RENDER_FORCE );
- $this->assertEquals( $out[0], $thumb->getWidth(), "$name: thumb reported width check for $size" );
- $this->assertEquals( $out[1], $thumb->getHeight(), "$name: thumb reported height check for $size" );
+ $this->assertEquals(
+ $out[0],
+ $thumb->getWidth(),
+ "$name: thumb reported width check for $size"
+ );
+ $this->assertEquals(
+ $out[1],
+ $thumb->getHeight(),
+ "$name: thumb reported height check for $size"
+ );
$gis = getimagesize( $thumb->getLocalCopyPath() );
if ( $out[0] > $info['width'] ) {
$file = $this->dataFile( $name, $type );
$thumb = $file->transform( $params, File::RENDER_NOW | File::RENDER_FORCE );
- $this->assertEquals( $out[0], $thumb->getWidth(), "$name: thumb reported width check for $size" );
- $this->assertEquals( $out[1], $thumb->getHeight(), "$name: thumb reported height check for $size" );
+ $this->assertEquals(
+ $out[0],
+ $thumb->getWidth(),
+ "$name: thumb reported width check for $size"
+ );
+ $this->assertEquals(
+ $out[1],
+ $thumb->getHeight(),
+ "$name: thumb reported height check for $size"
+ );
$gis = getimagesize( $thumb->getLocalCopyPath() );
if ( $out[0] > $info['width'] ) {
array( '', GIFHandler::METADATA_BAD ),
array( null, GIFHandler::METADATA_BAD ),
array( 'Something invalid!', GIFHandler::METADATA_BAD ),
+ // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
array( 'a:4:{s:10:"frameCount";i:1;s:6:"looped";b:0;s:8:"duration";d:0.1000000000000000055511151231257827021181583404541015625;s:8:"metadata";a:2:{s:14:"GIFFileComment";a:1:{i:0;s:35:"GIF test file ⁕ Created with GIMP";}s:15:"_MW_GIF_VERSION";i:1;}}', GIFHandler::METADATA_GOOD ),
+ // @codingStandardsIgnoreEnd
);
}
public static function provideGetMetadata() {
return array(
+ // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
array( 'nonanimated.gif', 'a:4:{s:10:"frameCount";i:1;s:6:"looped";b:0;s:8:"duration";d:0.1000000000000000055511151231257827021181583404541015625;s:8:"metadata";a:2:{s:14:"GIFFileComment";a:1:{i:0;s:35:"GIF test file ⁕ Created with GIMP";}s:15:"_MW_GIF_VERSION";i:1;}}' ),
array( 'animated-xmp.gif', 'a:4:{s:10:"frameCount";i:4;s:6:"looped";b:1;s:8:"duration";d:2.399999999999999911182158029987476766109466552734375;s:8:"metadata";a:5:{s:6:"Artist";s:7:"Bawolff";s:16:"ImageDescription";a:2:{s:9:"x-default";s:18:"A file to test GIF";s:5:"_type";s:4:"lang";}s:15:"SublocationDest";s:13:"The interwebs";s:14:"GIFFileComment";a:1:{i:0;s:16:"GIƒ·test·file";}s:15:"_MW_GIF_VERSION";i:1;}}' ),
+ // @codingStandardsIgnoreEnd
);
}
*/
public function testIPTCParseUTF8() {
// This has the magic "\x1c\x01\x5A\x00\x03\x1B\x25\x47" which marks content as UTF8.
- $iptcData = "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x0F\x1c\x02\x19\x00\x02¼\x1c\x01\x5A\x00\x03\x1B\x25\x47";
+ $iptcData =
+ "Photoshop 3.0\08BIM\4\4\0\0\0\0\0\x0F\x1c\x02\x19\x00\x02¼\x1c\x01\x5A\x00\x03\x1B\x25\x47";
$res = IPTC::Parse( $iptcData );
$this->assertEquals( array( '¼' ), $res['Keywords'] );
}
public function testPSIRExtraction() {
$res = JpegMetadataExtractor::segmentSplitter( $this->filePath . 'jpeg-xmp-psir.jpg' );
- $expected = '50686f746f73686f7020332e30003842494d04040000000000181c02190004746573741c02190003666f6f1c020000020004';
+ $expected = '50686f746f73686f7020332e30003842494d04040000000'
+ . '000181c02190004746573741c02190003666f6f1c020000020004';
$this->assertEquals( $expected, bin2hex( $res['PSIR'][0] ) );
}