3 require_once( 'PHPUnit.php' );
4 require_once( '../includes/Defines.php' );
5 require_once( '../includes/Profiling.php' );
6 require_once( '../includes/GlobalFunctions.php' );
7 require_once( '../includes/Image.php' );
9 class ImageTest
extends PHPUnit_TestCase
{
10 function ImageTest( $name ) {
11 $this->PHPUnit_TestCase( $name );
20 function testFitBoxWidth() {
50 foreach( $vals as $row ) {
52 foreach( $tests as $max => $expected ) {
53 $y = round( $expected * $height / $width );
54 $result = wfFitBoxWidth( $width, $height, $max );
55 $y2 = round( $result * $height / $width );
56 $this->assertEquals( $expected,
58 "($width, $height, $max) wanted: {$expected}x$y, got: {$result}x$y2" );
63 /* TODO: many more! */