MediaWiki  master
ContentHandlerTest Class Reference

ContentHandler Database. More...

Inheritance diagram for ContentHandlerTest:
Collaboration diagram for ContentHandlerTest:

Public Member Functions

 addDBDataOnce ()
 
 provideGetModelForID ()
 
 testDataIndexFields ()
 ContentHandler::getDataForSearchIndex. More...
 
 testGetAutosummary ()
 ContentHandler::getAutosummary. More...
 
 testGetChangeTag ()
 Test software tag that is added when content model of the page changes ContentHandler::getChangeTag. More...
 
 testGetContentModelsHook ()
 ContentHandler::getContentModels. More...
 
 testGetContentText_NonTextContent_fail ()
 ContentHandler::getContentText should have thrown an exception for non-text Content object MWException ContentHandler::getContentText. More...
 
 testGetContentText_NonTextContent_ignore ()
 ContentHandler::getContentText. More...
 
 testGetContentText_NonTextContent_serialize ()
 ContentHandler::getContentText. More...
 
 testGetContentText_Null ( $contentHandlerTextFallback)
 dataGetContentText_Null ContentHandler::getContentText More...
 
 testGetContentText_TextContent ( $contentHandlerTextFallback)
 dataGetContentText_TextContent ContentHandler::getContentText More...
 
 testGetDefaultModelFor ( $title, $expectedModelId)
 dataGetDefaultModelFor ContentHandler::getDefaultModelFor More...
 
 testGetFieldsForSearchIndex ()
 ContentHandler::getFieldsForSearchIndex. More...
 
 testGetForTitle ( $title, $expectedContentModel)
 dataGetDefaultModelFor ContentHandler::getForTitle More...
 
 testGetLocalizedName ( $id, $expected)
 dataGetLocalizedName ContentHandler::getLocalizedName More...
 
 testGetModelForID ( $modelId, $handlerClass)
 ContentHandler::getForModelID provideGetModelForID. More...
 
 testGetPageLanguage ( $title, $expected)
 dataGetPageLanguage ContentHandler::getPageLanguage More...
 
 testGetSlotDiffRenderer_bc ()
 ContentHandler::getSlotDiffRenderer. More...
 
 testGetSlotDiffRenderer_default ()
 ContentHandler::getSlotDiffRenderer. More...
 
 testGetSlotDiffRenderer_hook ()
 ContentHandler::getSlotDiffRenderer. More...
 
 testGetSlotDiffRenderer_nobc ()
 ContentHandler::getSlotDiffRenderer. More...
 
 testMakeContent ( $data, $title, $modelId, $format, $expectedModelId, $shouldFail)
 dataMakeContent ContentHandler::makeContent More...
 
 testParserOutputForIndexing ()
 ContentHandler::getParserOutputForIndexing. More...
 
 testSupportsCategories ()
 ContentHandler::supportsCategories. More...
 
 testSupportsDirectEditing ()
 ContentHandler::supportsDirectEditing. More...
 

Static Public Member Functions

static dataGetContentText_Null ()
 
static dataGetContentText_TextContent ()
 
static dataGetDefaultModelFor ()
 
static dataGetLocalizedName ()
 
static dataGetPageLanguage ()
 
static dataMakeContent ()
 
static dummyHookHandler ( $foo, &$text, $bar)
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Private Member Functions

 newSearchEngine ()
 

Detailed Description

ContentHandler Database.

Definition at line 10 of file ContentHandlerTest.php.

Member Function Documentation

◆ addDBDataOnce()

ContentHandlerTest::addDBDataOnce ( )

Definition at line 49 of file ContentHandlerTest.php.

◆ dataGetContentText_Null()

static ContentHandlerTest::dataGetContentText_Null ( )
static

Definition at line 166 of file ContentHandlerTest.php.

◆ dataGetContentText_TextContent()

static ContentHandlerTest::dataGetContentText_TextContent ( )
static

Definition at line 187 of file ContentHandlerTest.php.

◆ dataGetDefaultModelFor()

static ContentHandlerTest::dataGetDefaultModelFor ( )
static

◆ dataGetLocalizedName()

static ContentHandlerTest::dataGetLocalizedName ( )
static

Definition at line 102 of file ContentHandlerTest.php.

References CONTENT_MODEL_JAVASCRIPT, and null.

◆ dataGetPageLanguage()

static ContentHandlerTest::dataGetPageLanguage ( )
static

Definition at line 131 of file ContentHandlerTest.php.

References $wgLanguageCode, and CONTENT_MODEL_JAVASCRIPT.

◆ dataMakeContent()

static ContentHandlerTest::dataMakeContent ( )
static

◆ dummyHookHandler()

static ContentHandlerTest::dummyHookHandler (   $foo,
$text,
  $bar 
)
static

Definition at line 375 of file ContentHandlerTest.php.

References null.

◆ newSearchEngine()

ContentHandlerTest::newSearchEngine ( )
private

Definition at line 424 of file ContentHandlerTest.php.

References $name, $type, and class.

Referenced by testGetFieldsForSearchIndex().

◆ provideGetModelForID()

ContentHandlerTest::provideGetModelForID ( )

◆ setUp()

ContentHandlerTest::setUp ( )
protected

◆ tearDown()

ContentHandlerTest::tearDown ( )
protected

Definition at line 42 of file ContentHandlerTest.php.

◆ testDataIndexFields()

◆ testGetAutosummary()

ContentHandlerTest::testGetAutosummary ( )

ContentHandler::getAutosummary.

Test if we become a "Created blank page" summary from getAutoSummary if no Content added to page.

Definition at line 327 of file ContentHandlerTest.php.

References $content, $title, CONTENT_MODEL_WIKITEXT, ContentHandler\makeContent(), Title\newFromText(), null, text, and wfMessage().

◆ testGetChangeTag()

ContentHandlerTest::testGetChangeTag ( )

Test software tag that is added when content model of the page changes ContentHandler::getChangeTag.

Definition at line 347 of file ContentHandlerTest.php.

References CONTENT_MODEL_JAVASCRIPT, CONTENT_MODEL_WIKITEXT, EDIT_UPDATE, ContentHandler\makeContent(), and null.

◆ testGetContentModelsHook()

ContentHandlerTest::testGetContentModelsHook ( )

◆ testGetContentText_NonTextContent_fail()

ContentHandlerTest::testGetContentText_NonTextContent_fail ( )

ContentHandler::getContentText should have thrown an exception for non-text Content object MWException ContentHandler::getContentText.

Definition at line 213 of file ContentHandlerTest.php.

References $content, and ContentHandler\getContentText().

◆ testGetContentText_NonTextContent_ignore()

ContentHandlerTest::testGetContentText_NonTextContent_ignore ( )

◆ testGetContentText_NonTextContent_serialize()

ContentHandlerTest::testGetContentText_NonTextContent_serialize ( )

◆ testGetContentText_Null()

ContentHandlerTest::testGetContentText_Null (   $contentHandlerTextFallback)

dataGetContentText_Null ContentHandler::getContentText

Definition at line 178 of file ContentHandlerTest.php.

References $content, ContentHandler\getContentText(), and null.

◆ testGetContentText_TextContent()

ContentHandlerTest::testGetContentText_TextContent (   $contentHandlerTextFallback)

dataGetContentText_TextContent ContentHandler::getContentText

Definition at line 199 of file ContentHandlerTest.php.

References $content, and ContentHandler\getContentText().

◆ testGetDefaultModelFor()

ContentHandlerTest::testGetDefaultModelFor (   $title,
  $expectedModelId 
)

◆ testGetFieldsForSearchIndex()

ContentHandlerTest::testGetFieldsForSearchIndex ( )

◆ testGetForTitle()

ContentHandlerTest::testGetForTitle (   $title,
  $expectedContentModel 
)

dataGetDefaultModelFor ContentHandler::getForTitle

Definition at line 95 of file ContentHandlerTest.php.

References $handler, $title, ContentHandler\getForTitle(), and Title\newFromText().

◆ testGetLocalizedName()

ContentHandlerTest::testGetLocalizedName (   $id,
  $expected 
)

dataGetLocalizedName ContentHandler::getLocalizedName

Definition at line 116 of file ContentHandlerTest.php.

References $name, and ContentHandler\getLocalizedName().

◆ testGetModelForID()

ContentHandlerTest::testGetModelForID (   $modelId,
  $handlerClass 
)

ContentHandler::getForModelID provideGetModelForID.

Definition at line 401 of file ContentHandlerTest.php.

References $handler, and ContentHandler\getForModelID().

◆ testGetPageLanguage()

ContentHandlerTest::testGetPageLanguage (   $title,
  $expected 
)

◆ testGetSlotDiffRenderer_bc()

ContentHandlerTest::testGetSlotDiffRenderer_bc ( )

◆ testGetSlotDiffRenderer_default()

ContentHandlerTest::testGetSlotDiffRenderer_default ( )

◆ testGetSlotDiffRenderer_hook()

ContentHandlerTest::testGetSlotDiffRenderer_hook ( )

◆ testGetSlotDiffRenderer_nobc()

ContentHandlerTest::testGetSlotDiffRenderer_nobc ( )

◆ testMakeContent()

ContentHandlerTest::testMakeContent (   $data,
  $title,
  $modelId,
  $format,
  $expectedModelId,
  $shouldFail 
)

◆ testParserOutputForIndexing()

ContentHandlerTest::testParserOutputForIndexing ( )

◆ testSupportsCategories()

ContentHandlerTest::testSupportsCategories ( )

◆ testSupportsDirectEditing()

ContentHandlerTest::testSupportsDirectEditing ( )

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