6 class MediaHandlerTest
extends MediaWikiTestCase
{
9 * @covers MediaHandler::fitBoxWidth
10 * @todo split into a dataprovider and test method
12 public function testFitBoxWidth() {
42 foreach ( $vals as $row ) {
43 $tests = $row['tests'];
44 $height = $row['height'];
45 $width = $row['width'];
46 foreach ( $tests as $max => $expected ) {
47 $y = round( $expected * $height / $width );
48 $result = MediaHandler
::fitBoxWidth( $width, $height, $max );
49 $y2 = round( $result * $height / $width );
50 $this->assertEquals( $expected,
52 "($width, $height, $max) wanted: {$expected}x$y, got: {$result}x$y2" );