3 require 'ImageFunctions.php';
5 class ImageFunctionsTest
extends PHPUnit_Framework_TestCase
{
6 function testFitBoxWidth() {
36 foreach( $vals as $row ) {
38 foreach( $tests as $max => $expected ) {
39 $y = round( $expected * $height / $width );
40 $result = wfFitBoxWidth( $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" );