4 define( 'MEDIAWIKI', true );
7 require 'includes/Defines.php';
40 plan( 3 +
3 * count( $vals ) );
42 require_ok( 'includes/ProfilerStub.php' );
43 require_ok( 'includes/GlobalFunctions.php' );
44 require_ok( 'includes/ImageFunctions.php' );
46 foreach( $vals as $row ) {
48 foreach( $tests as $max => $expected ) {
49 $y = round( $expected * $height / $width );
50 $result = wfFitBoxWidth( $width, $height, $max );
51 $y2 = round( $result * $height / $width );
52 is( $result, $expected,
53 "($width, $height, $max) wanted: {$expected}x{$y}, got: {$result}x{$y2}" );