mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PageImages
synced 2024-11-15 20:09:54 +00:00
d9df7178a0
This patch only moves existing code around, but does not change any implementation detail. I found it very suprising that all code called by this hook handler is 100% exclusive to this hook handler. There is zero interaction between this hook handlers code and all other code. Why is it in the same file then? And why is it all static? It doesn't have to be. I had to change literally nothing, except cutting and pasting, removing all "static" and replacing all "self::..." with "$this->...". That's all. Change-Id: I5ffe6fdf4e57135e6f3b32636c80f22be758607c
37 lines
718 B
PHP
37 lines
718 B
PHP
<?php
|
|
|
|
namespace PageImages\Tests;
|
|
|
|
use MediaWikiTestCase;
|
|
use PageImages;
|
|
use Title;
|
|
|
|
/**
|
|
* @covers PageImages
|
|
*
|
|
* @group PageImages
|
|
* @group Database
|
|
*
|
|
* @license WTFPL 2.0
|
|
* @author Thiemo Mättig
|
|
*/
|
|
class PageImagesTest extends MediaWikiTestCase {
|
|
|
|
public function testPagePropertyName() {
|
|
$this->assertSame( 'page_image', PageImages::PROP_NAME );
|
|
}
|
|
|
|
public function testConstructor() {
|
|
$pageImages = new PageImages();
|
|
$this->assertInstanceOf( 'PageImages', $pageImages );
|
|
}
|
|
|
|
public function testGivenNonExistingPage_getPageImageReturnsFalse() {
|
|
$title = Title::newFromText( wfRandomString() );
|
|
$title->resetArticleID( 0 );
|
|
|
|
$this->assertFalse( PageImages::getPageImage( $title ) );
|
|
}
|
|
|
|
}
|