mediawiki-extensions-PageIm.../tests/phpunit/PageImagesTest.php
Thiemo Mättig d9df7178a0 Extract LinksUpdateHookHandler to separate file
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
2015-12-30 13:40:48 +01:00

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 ) );
}
}