MediaWiki REL1_34
PageImages\Tests\Hooks\LinksUpdateHookHandlerTest Class Reference

@covers \PageImages\Hooks\LinksUpdateHookHandler More...

Inheritance diagram for PageImages\Tests\Hooks\LinksUpdateHookHandlerTest:
Collaboration diagram for PageImages\Tests\Hooks\LinksUpdateHookHandlerTest:

Public Member Functions

 provideDoLinksUpdate ()
 
 provideGetScore ()
 
 provideIsFreeImage ()
 
 provideScoreFromTable ()
 
 setUp ()
 
 tearDown ()
 
 testDoLinksUpdate (array $images, $expectedFreeFileName, $expectedNonFreeFileName)
 @dataProvider provideDoLinksUpdate @covers \PageImages\Hooks\LinksUpdateHookHandler::doLinksUpdate
 
 testGetPageImageCandidates ()
 @covers \PageImages\Hooks\LinksUpdateHookHandler::getPageImageCandidates
 
 testGetScore ( $image, $scoreFromTable, $position, $expected)
 @dataProvider provideGetScore
 
 testIsFreeImage ( $fileName, $metadata, $expected)
 @dataProvider provideIsFreeImage @covers \PageImages\Hooks\LinksUpdateHookHandler::isImageFree
 
 testScoreFromTable (array $scores, $value, $expected)
 @dataProvider provideScoreFromTable @covers \PageImages\Hooks\LinksUpdateHookHandler::scoreFromTable
 

Private Member Functions

 getLinksUpdate (array $images, $leadImages=false)
 
 getRepoGroup ()
 Required to make wfFindFile in LinksUpdateHookHandler::getScore return something.
 

Detailed Description

@covers \PageImages\Hooks\LinksUpdateHookHandler

@group PageImages

Note
WTFPL
Author
Thiemo Kreuz

Definition at line 22 of file LinksUpdateHookHandlerTest.php.

Member Function Documentation

◆ getLinksUpdate()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::getLinksUpdate ( array $images,
$leadImages = false )
private

◆ getRepoGroup()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::getRepoGroup ( )
private

Required to make wfFindFile in LinksUpdateHookHandler::getScore return something.

Returns
RepoGroup

Definition at line 97 of file LinksUpdateHookHandlerTest.php.

References $file.

Referenced by PageImages\Tests\Hooks\LinksUpdateHookHandlerTest\testIsFreeImage().

◆ provideDoLinksUpdate()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::provideDoLinksUpdate ( )

Definition at line 164 of file LinksUpdateHookHandlerTest.php.

References true.

◆ provideGetScore()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::provideGetScore ( )

Definition at line 249 of file LinksUpdateHookHandlerTest.php.

◆ provideIsFreeImage()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::provideIsFreeImage ( )

Definition at line 362 of file LinksUpdateHookHandlerTest.php.

References true.

◆ provideScoreFromTable()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::provideScoreFromTable ( )

Definition at line 300 of file LinksUpdateHookHandlerTest.php.

◆ setUp()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::setUp ( )

Definition at line 30 of file LinksUpdateHookHandlerTest.php.

◆ tearDown()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::tearDown ( )

Definition at line 24 of file LinksUpdateHookHandlerTest.php.

References RepoGroup\destroySingleton().

◆ testDoLinksUpdate()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::testDoLinksUpdate ( array $images,
$expectedFreeFileName,
$expectedNonFreeFileName )

@dataProvider provideDoLinksUpdate @covers \PageImages\Hooks\LinksUpdateHookHandler::doLinksUpdate

Definition at line 120 of file LinksUpdateHookHandlerTest.php.

References PageImages\Tests\Hooks\LinksUpdateHookHandlerTest\getLinksUpdate().

◆ testGetPageImageCandidates()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::testGetPageImageCandidates ( )

@covers \PageImages\Hooks\LinksUpdateHookHandler::getPageImageCandidates

Definition at line 208 of file LinksUpdateHookHandlerTest.php.

References PageImages\Tests\Hooks\LinksUpdateHookHandlerTest\getLinksUpdate().

◆ testGetScore()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::testGetScore ( $image,
$scoreFromTable,
$position,
$expected )

@dataProvider provideGetScore

Definition at line 229 of file LinksUpdateHookHandlerTest.php.

◆ testIsFreeImage()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::testIsFreeImage ( $fileName,
$metadata,
$expected )

@dataProvider provideIsFreeImage @covers \PageImages\Hooks\LinksUpdateHookHandler::isImageFree

Definition at line 349 of file LinksUpdateHookHandlerTest.php.

References PageImages\Tests\Hooks\LinksUpdateHookHandlerTest\getRepoGroup(), and RepoGroup\setSingleton().

◆ testScoreFromTable()

PageImages\Tests\Hooks\LinksUpdateHookHandlerTest::testScoreFromTable ( array $scores,
$value,
$expected )

@dataProvider provideScoreFromTable @covers \PageImages\Hooks\LinksUpdateHookHandler::scoreFromTable

Definition at line 293 of file LinksUpdateHookHandlerTest.php.


The documentation for this class was generated from the following file: