summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/ImagePage404Test.php
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:30:02 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:30:02 -0400
commit1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch)
treef1fdd326034e05177596851be6a7127615d81498 /tests/phpunit/includes/ImagePage404Test.php
parent9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff)
parentf6d65e533c62f6deb21342d4901ece24497b433e (diff)
Merge commit 'f6d65'
# Conflicts: # skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'tests/phpunit/includes/ImagePage404Test.php')
-rw-r--r--tests/phpunit/includes/ImagePage404Test.php53
1 files changed, 0 insertions, 53 deletions
diff --git a/tests/phpunit/includes/ImagePage404Test.php b/tests/phpunit/includes/ImagePage404Test.php
deleted file mode 100644
index 197a2b32..00000000
--- a/tests/phpunit/includes/ImagePage404Test.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/**
- * For doing Image Page tests that rely on 404 thumb handling
- */
-class ImagePage404Test extends MediaWikiMediaTestCase {
-
- protected function getRepoOptions() {
- return parent::getRepoOptions() + array( 'transformVia404' => true );
- }
-
- function setUp() {
- $this->setMwGlobals( 'wgImageLimits', array(
- array( 320, 240 ),
- array( 640, 480 ),
- array( 800, 600 ),
- array( 1024, 768 ),
- array( 1280, 1024 )
- ) );
- parent::setUp();
- }
-
- function getImagePage( $filename ) {
- $title = Title::makeTitleSafe( NS_FILE, $filename );
- $file = $this->dataFile( $filename );
- $iPage = new ImagePage( $title );
- $iPage->setFile( $file );
- return $iPage;
- }
-
- /**
- * @dataProvider providerGetThumbSizes
- * @param string $filename
- * @param int $expectedNumberThumbs How many thumbnails to show
- */
- function testGetThumbSizes( $filename, $expectedNumberThumbs ) {
- $iPage = $this->getImagePage( $filename );
- $reflection = new ReflectionClass( $iPage );
- $reflMethod = $reflection->getMethod( 'getThumbSizes' );
- $reflMethod->setAccessible( true );
-
- $actual = $reflMethod->invoke( $iPage, 545, 700 );
- $this->assertEquals( count( $actual ), $expectedNumberThumbs );
- }
-
- function providerGetThumbSizes() {
- return array(
- array( 'animated.gif', 6 ),
- array( 'Toll_Texas_1.svg', 6 ),
- array( '80x60-Greyscale.xcf', 6 ),
- array( 'jpeg-comment-binary.jpg', 6 ),
- );
- }
-}