dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add @covers tags to media tests
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
media
/
BitmapScalingTest.php
diff --git
a/tests/phpunit/includes/media/BitmapScalingTest.php
b/tests/phpunit/includes/media/BitmapScalingTest.php
index
d355e17
..
92a927f
100644
(file)
--- a/
tests/phpunit/includes/media/BitmapScalingTest.php
+++ b/
tests/phpunit/includes/media/BitmapScalingTest.php
@@
-8,10
+8,10
@@
class BitmapScalingTest extends MediaWikiTestCase {
protected function setUp() {
parent::setUp();
protected function setUp() {
parent::setUp();
- $this->setMwGlobals(
array(
+ $this->setMwGlobals(
[
'wgMaxImageArea' => 1.25e7, // 3500x3500
'wgCustomConvertCommand' => 'dummy', // Set so that we don't get client side rendering
'wgMaxImageArea' => 1.25e7, // 3500x3500
'wgCustomConvertCommand' => 'dummy', // Set so that we don't get client side rendering
-
)
);
+
]
);
}
/**
}
/**
@@
-27,103
+27,103
@@
class BitmapScalingTest extends MediaWikiTestCase {
}
public static function provideNormaliseParams() {
}
public static function provideNormaliseParams() {
- return
array(
+ return
[
/* Regular resize operations */
/* Regular resize operations */
- array(
-
array( 1024, 768 )
,
- array(
+ [
+
[ 1024, 768 ]
,
+ [
'width' => 512, 'height' => 384,
'physicalWidth' => 512, 'physicalHeight' => 384,
'page' => 1, 'interlace' => false,
'width' => 512, 'height' => 384,
'physicalWidth' => 512, 'physicalHeight' => 384,
'page' => 1, 'interlace' => false,
-
)
,
-
array( 'width' => 512 )
,
+
]
,
+
[ 'width' => 512 ]
,
'Resizing with width set',
'Resizing with width set',
-
)
,
- array(
-
array( 1024, 768 )
,
- array(
+
]
,
+ [
+
[ 1024, 768 ]
,
+ [
'width' => 512, 'height' => 384,
'physicalWidth' => 512, 'physicalHeight' => 384,
'page' => 1, 'interlace' => false,
'width' => 512, 'height' => 384,
'physicalWidth' => 512, 'physicalHeight' => 384,
'page' => 1, 'interlace' => false,
-
)
,
-
array( 'width' => 512, 'height' => 768 )
,
+
]
,
+
[ 'width' => 512, 'height' => 768 ]
,
'Resizing with height set too high',
'Resizing with height set too high',
-
)
,
- array(
-
array( 1024, 768 )
,
- array(
+
]
,
+ [
+
[ 1024, 768 ]
,
+ [
'width' => 512, 'height' => 384,
'physicalWidth' => 512, 'physicalHeight' => 384,
'page' => 1, 'interlace' => false,
'width' => 512, 'height' => 384,
'physicalWidth' => 512, 'physicalHeight' => 384,
'page' => 1, 'interlace' => false,
-
)
,
-
array( 'width' => 1024, 'height' => 384 )
,
+
]
,
+
[ 'width' => 1024, 'height' => 384 ]
,
'Resizing with height set',
'Resizing with height set',
-
)
,
+
]
,
/* Very tall images */
/* Very tall images */
- array(
-
array( 1000, 100 )
,
- array(
+ [
+
[ 1000, 100 ]
,
+ [
'width' => 5, 'height' => 1,
'physicalWidth' => 5, 'physicalHeight' => 1,
'page' => 1, 'interlace' => false,
'width' => 5, 'height' => 1,
'physicalWidth' => 5, 'physicalHeight' => 1,
'page' => 1, 'interlace' => false,
-
)
,
-
array( 'width' => 5 )
,
+
]
,
+
[ 'width' => 5 ]
,
'Very wide image',
'Very wide image',
-
)
,
+
]
,
- array(
-
array( 100, 1000 )
,
- array(
+ [
+
[ 100, 1000 ]
,
+ [
'width' => 1, 'height' => 10,
'physicalWidth' => 1, 'physicalHeight' => 10,
'page' => 1, 'interlace' => false,
'width' => 1, 'height' => 10,
'physicalWidth' => 1, 'physicalHeight' => 10,
'page' => 1, 'interlace' => false,
-
)
,
-
array( 'width' => 1 )
,
+
]
,
+
[ 'width' => 1 ]
,
'Very high image',
'Very high image',
-
)
,
- array(
-
array( 100, 1000 )
,
- array(
+
]
,
+ [
+
[ 100, 1000 ]
,
+ [
'width' => 1, 'height' => 5,
'physicalWidth' => 1, 'physicalHeight' => 10,
'page' => 1, 'interlace' => false,
'width' => 1, 'height' => 5,
'physicalWidth' => 1, 'physicalHeight' => 10,
'page' => 1, 'interlace' => false,
-
)
,
-
array( 'width' => 10, 'height' => 5 )
,
+
]
,
+
[ 'width' => 10, 'height' => 5 ]
,
'Very high image with height set',
'Very high image with height set',
-
)
,
+
]
,
/* Max image area */
/* Max image area */
- array(
-
array( 4000, 4000 )
,
- array(
+ [
+
[ 4000, 4000 ]
,
+ [
'width' => 5000, 'height' => 5000,
'physicalWidth' => 4000, 'physicalHeight' => 4000,
'page' => 1, 'interlace' => false,
'width' => 5000, 'height' => 5000,
'physicalWidth' => 4000, 'physicalHeight' => 4000,
'page' => 1, 'interlace' => false,
-
)
,
-
array( 'width' => 5000 )
,
+
]
,
+
[ 'width' => 5000 ]
,
'Bigger than max image size but doesn\'t need scaling',
'Bigger than max image size but doesn\'t need scaling',
-
)
,
+
]
,
/* Max interlace image area */
/* Max interlace image area */
- array(
-
array( 4000, 4000 )
,
- array(
+ [
+
[ 4000, 4000 ]
,
+ [
'width' => 5000, 'height' => 5000,
'physicalWidth' => 4000, 'physicalHeight' => 4000,
'page' => 1, 'interlace' => false,
'width' => 5000, 'height' => 5000,
'physicalWidth' => 4000, 'physicalHeight' => 4000,
'page' => 1, 'interlace' => false,
-
)
,
-
array( 'width' => 5000, 'interlace' => true )
,
+
]
,
+
[ 'width' => 5000, 'interlace' => true ]
,
'Interlace bigger than max interlace area',
'Interlace bigger than max interlace area',
-
)
,
-
)
;
+
]
,
+
]
;
}
/**
* @covers BitmapHandler::doTransform
*/
public function testTooBigImage() {
}
/**
* @covers BitmapHandler::doTransform
*/
public function testTooBigImage() {
- $file = new FakeDimensionFile(
array( 4000, 4000 )
);
+ $file = new FakeDimensionFile(
[ 4000, 4000 ]
);
$handler = new BitmapHandler;
$handler = new BitmapHandler;
- $params =
array( 'width' => '3700' )
; // Still bigger than max size.
+ $params =
[ 'width' => '3700' ]
; // Still bigger than max size.
$this->assertEquals( 'TransformTooBigImageAreaError',
get_class( $handler->doTransform( $file, 'dummy path', '', $params ) ) );
}
$this->assertEquals( 'TransformTooBigImageAreaError',
get_class( $handler->doTransform( $file, 'dummy path', '', $params ) ) );
}
@@
-132,10
+132,10
@@
class BitmapScalingTest extends MediaWikiTestCase {
* @covers BitmapHandler::doTransform
*/
public function testTooBigMustRenderImage() {
* @covers BitmapHandler::doTransform
*/
public function testTooBigMustRenderImage() {
- $file = new FakeDimensionFile(
array( 4000, 4000 )
);
+ $file = new FakeDimensionFile(
[ 4000, 4000 ]
);
$file->mustRender = true;
$handler = new BitmapHandler;
$file->mustRender = true;
$handler = new BitmapHandler;
- $params =
array( 'width' => '5000' )
; // Still bigger than max size.
+ $params =
[ 'width' => '5000' ]
; // Still bigger than max size.
$this->assertEquals( 'TransformTooBigImageAreaError',
get_class( $handler->doTransform( $file, 'dummy path', '', $params ) ) );
}
$this->assertEquals( 'TransformTooBigImageAreaError',
get_class( $handler->doTransform( $file, 'dummy path', '', $params ) ) );
}
@@
-144,7
+144,7
@@
class BitmapScalingTest extends MediaWikiTestCase {
* @covers BitmapHandler::getImageArea
*/
public function testImageArea() {
* @covers BitmapHandler::getImageArea
*/
public function testImageArea() {
- $file = new FakeDimensionFile(
array( 7, 9 )
);
+ $file = new FakeDimensionFile(
[ 7, 9 ]
);
$handler = new BitmapHandler;
$this->assertEquals( 63, $handler->getImageArea( $file ) );
}
$handler = new BitmapHandler;
$this->assertEquals( 63, $handler->getImageArea( $file ) );
}