3 class MediaHandlerTest
extends MediaWikiTestCase
{
4 function testFitBoxWidth() {
34 foreach ( $vals as $row ) {
35 $tests = $row['tests'];
36 $height = $row['height'];
37 $width = $row['width'];
38 foreach ( $tests as $max => $expected ) {
39 $y = round( $expected * $height / $width );
40 $result = MediaHandler
::fitBoxWidth( $width, $height, $max );
41 $y2 = round( $result * $height / $width );
42 $this->assertEquals( $expected,
44 "($width, $height, $max) wanted: {$expected}x$y, got: {$result}x$y2" );