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