MediaWiki  master
DifferenceEngineTest Class Reference

DifferenceEngine. More...

Inheritance diagram for DifferenceEngineTest:
Collaboration diagram for DifferenceEngineTest:

Public Member Functions

 provideGenerateContentDiffBody ()
 
 provideGetDiffBody ()
 
 provideLocaliseTitleTooltipsTestData ()
 
 testAddLocalisedTitleTooltips ( $input, $expected)
 provideLocaliseTitleTooltipsTestData More...
 
 testGenerateContentDiffBody (Content $oldContent, Content $newContent, $expectedDiff)
 provideGenerateContentDiffBody More...
 
 testGenerateTextDiffBody ()
 
 testGetDiffBody (RevisionRecord $oldRevision=null, RevisionRecord $newRevision=null, $expectedDiff)
 provideGetDiffBody More...
 
 testGetNewid ()
 
 testGetOldid ()
 
 testLoadRevisionData ()
 
 testMapDiffPrevNext ()
 
 testRecursion ()
 
 testSetContent ()
 
 testSetRevisions ()
 

Protected Member Functions

 doEdits ()
 
 getTitle ()
 
 setUp ()
 

Protected Attributes

 $context
 

Private Member Functions

 getLoadRevisionDataCases ()
 
 getMapDiffPrevNextCases ()
 
 getMockTitle ( $id=23)
 
 getPlainDiff ( $diff)
 Convert a HTML diff to a human-readable format and hopefully make the test less fragile. More...
 
 getRevisionRecord (... $slots)
 

Static Private Attributes

static $revisions
 

Detailed Description

DifferenceEngine.

Todo:
tests for the rest of DifferenceEngine!

Database Diff

Author
Katie Filbert < aude..nosp@m.wiki.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >

Definition at line 18 of file DifferenceEngineTest.php.

Member Function Documentation

◆ doEdits()

DifferenceEngineTest::doEdits ( )
protected
Returns
int[] Revision ids

Definition at line 48 of file DifferenceEngineTest.php.

References $content, $revisions, $title, as, WikiPage\factory(), getTitle(), and ContentHandler\makeContent().

Referenced by setUp().

◆ getLoadRevisionDataCases()

DifferenceEngineTest::getLoadRevisionDataCases ( )
private

Definition at line 103 of file DifferenceEngineTest.php.

Referenced by testLoadRevisionData().

◆ getMapDiffPrevNextCases()

DifferenceEngineTest::getMapDiffPrevNextCases ( )
private

Definition at line 76 of file DifferenceEngineTest.php.

Referenced by testMapDiffPrevNext().

◆ getMockTitle()

DifferenceEngineTest::getMockTitle (   $id = 23)
private
Parameters
int$id
Returns
Title

Definition at line 350 of file DifferenceEngineTest.php.

References class.

Referenced by getRevisionRecord().

◆ getPlainDiff()

DifferenceEngineTest::getPlainDiff (   $diff)
private

Convert a HTML diff to a human-readable format and hopefully make the test less fragile.

Parameters
stringdiff
Returns
string

Definition at line 337 of file DifferenceEngineTest.php.

Referenced by testGenerateContentDiffBody(), testGenerateTextDiffBody(), testGetDiffBody(), and testSetContent().

◆ getRevisionRecord()

DifferenceEngineTest::getRevisionRecord (   $slots)
private
Parameters
SlotRecord[]$slots
Returns
MutableRevisionRecord

Definition at line 368 of file DifferenceEngineTest.php.

References $title, as, and getMockTitle().

Referenced by provideGetDiffBody(), and testSetRevisions().

◆ getTitle()

DifferenceEngineTest::getTitle ( )
protected
Returns
Title

Definition at line 40 of file DifferenceEngineTest.php.

References Title\newFromText().

Referenced by doEdits(), and setUp().

◆ provideGenerateContentDiffBody()

DifferenceEngineTest::provideGenerateContentDiffBody ( )

◆ provideGetDiffBody()

DifferenceEngineTest::provideGetDiffBody ( )

◆ provideLocaliseTitleTooltipsTestData()

DifferenceEngineTest::provideLocaliseTitleTooltipsTestData ( )

Definition at line 130 of file DifferenceEngineTest.php.

◆ setUp()

DifferenceEngineTest::setUp ( )
protected

Definition at line 24 of file DifferenceEngineTest.php.

References $title, doEdits(), and getTitle().

◆ testAddLocalisedTitleTooltips()

DifferenceEngineTest::testAddLocalisedTitleTooltips (   $input,
  $expected 
)

provideLocaliseTitleTooltipsTestData

Definition at line 150 of file DifferenceEngineTest.php.

References $input.

◆ testGenerateContentDiffBody()

DifferenceEngineTest::testGenerateContentDiffBody ( Content  $oldContent,
Content  $newContent,
  $expectedDiff 
)

provideGenerateContentDiffBody

Definition at line 159 of file DifferenceEngineTest.php.

References $differenceEngine, and getPlainDiff().

◆ testGenerateTextDiffBody()

DifferenceEngineTest::testGenerateTextDiffBody ( )

Definition at line 186 of file DifferenceEngineTest.php.

References $differenceEngine, and getPlainDiff().

◆ testGetDiffBody()

DifferenceEngineTest::testGetDiffBody ( RevisionRecord  $oldRevision = null,
RevisionRecord  $newRevision = null,
  $expectedDiff 
)

provideGetDiffBody

Definition at line 240 of file DifferenceEngineTest.php.

References $differenceEngine, and getPlainDiff().

◆ testGetNewid()

DifferenceEngineTest::testGetNewid ( )

Definition at line 123 of file DifferenceEngineTest.php.

◆ testGetOldid()

DifferenceEngineTest::testGetOldid ( )

Definition at line 116 of file DifferenceEngineTest.php.

◆ testLoadRevisionData()

DifferenceEngineTest::testLoadRevisionData ( )

Definition at line 86 of file DifferenceEngineTest.php.

References $ret, as, getLoadRevisionDataCases(), and list.

◆ testMapDiffPrevNext()

DifferenceEngineTest::testMapDiffPrevNext ( )

Definition at line 64 of file DifferenceEngineTest.php.

References as, getMapDiffPrevNextCases(), and list.

◆ testRecursion()

DifferenceEngineTest::testRecursion ( )

Definition at line 301 of file DifferenceEngineTest.php.

References class, and RequestContext\getMain().

◆ testSetContent()

DifferenceEngineTest::testSetContent ( )

◆ testSetRevisions()

DifferenceEngineTest::testSetRevisions ( )

Member Data Documentation

◆ $context

DifferenceEngineTest::$context
protected

Definition at line 20 of file DifferenceEngineTest.php.

◆ $revisions

DifferenceEngineTest::$revisions
staticprivate

Definition at line 22 of file DifferenceEngineTest.php.

Referenced by doEdits().


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