Wikidata/Notes/ContentHandler/Testing

This is a short overview of testing for the Wikidata branch which introduces the ContentHandler facility.

Unit Testing

edit

Both Content and ContentHandler are covered by an extensive set of PHPUnit tests. More of their functionality is covered by the test cases for Revision and WikiPage, as well as Title.

TODO: check and improve coverage

User Interface

edit

Only basic eyeball testing has been performed:

  • standard view/edit/preview/save cycles, for wikitext, CSS and JavaScript.
edit

Basic Build-In search should work for wikitext as usual. However, search for non-textual content models is not yet supported well.

No extra tests have been implemented to see whether the build-in search still works as expected.

TODO: check coverage, test non-text search.

Currently, Content::getTextForSearchIndex() returns a text to be analyzed by the fulltext engine. It would be much nicer if:

  • The Content object could (optionally?) provide tokens to the indexer directly
  • The Content object could have a function for providing snippets for the search result page.

Generally, the search infrastructure should be made aware of content model.

APIs

edit

api.php

edit

Several API modules have been changed to use the ContentHandler facility internally. These changes should be covered by test cases for these API modules, but this has not been verified.

Some API modules have been (or will be) amended to expose the content model and serialization format:

  • ApiQueryRevision
  • ApiEditPage


Test cases for these changes are pending.

Atom Feeds

edit

Export/Import

edit

Export has been modified to export the data model and serialization format. This was tested briefly by hand.

Import has been modified to use any information about content model and serialization format found in the input. This was not yet tested.

External Edit

edit

This is pending, with no defined behavior for non-text content.

Extensions using Content

edit

Several extensions may be affected by the ContentHandler logic, but this has not been surveyed or tested yet:

ExpandTemplates

edit

MWSearch

edit

SyntaxHighlight

edit

The display of CSS and JavaScript pages should work as before, though the detection of what is a JS/CSS page should now be using the ContentHandler.

Note: In the future, the ContentHandler may provide a special interface for highlighters to register with, instead of hooking into the page view workflow.

OAIRepository

edit

Collection

edit

AntiBot

edit

Abuse Filter

edit

SimpleAntiSpam

edit

SpamBlacklist

edit

Other Extensions

edit

Some other extensions may be affected by the refactoring of WikiPage, Article, EditPage, etc.

A survey of which extensions use now-deprecated hooks is pending.