3 use Wikimedia\TestingAccessWrapper;
22 $iPage->setFile(
$file );
34 $reflection =
new ReflectionClass( $iPage );
35 $reflMethod = $reflection->getMethod(
'getDisplayWidthHeight' );
36 $reflMethod->setAccessible(
true );
38 $actual = $reflMethod->invoke( $iPage, $dim[0], $dim[1], $dim[2], $dim[3] );
39 $this->assertEquals( $actual, $expected );
45 [ 1024.0, 768.0, 600.0, 600.0 ],
49 [ 1024.0, 768.0, 1600.0, 600.0 ],
53 [ 1024.0, 768.0, 1024.0, 768.0 ],
57 [ 1024.0, 768.0, 800.0, 1000.0 ],
61 [ 1024.0, 768.0, 0, 1000 ],
65 [ 1024.0, 768.0, 2000, 0 ],
79 $reflection =
new ReflectionClass( $iPage );
80 $reflMethod = $reflection->getMethod(
'getThumbSizes' );
81 $reflMethod->setAccessible(
true );
83 $actual = $reflMethod->invoke( $iPage, 545, 700 );
84 $this->assertEquals(
count( $actual ), $expectedNumberThumbs );
89 [
'animated.gif', 2 ],
90 [
'Toll_Texas_1.svg', 1 ],
91 [
'80x60-Greyscale.xcf', 1 ],
92 [
'jpeg-comment-binary.jpg', 2 ],
106 if (
$lang !==
null ) {
113 $page = TestingAccessWrapper::newFromObject( $page );
116 $result = $page->getLanguageForRendering(
$request, $page->getDisplayedFile() );
117 $this->assertEquals( $expected,
$result );
123 [
'ru',
'ru',
'ru' ],
126 [
null,
'en',
'en' ],
127 [
null,
'fr',
'fr' ],
128 [
null,
'ru',
'en' ],
129 [
'de',
'ru',
'de' ],