Wikidata/Notes/ContentHandler/Testing
This is a short overview of testing for the Wikidata branch which introduces the ContentHandler facility.
Unit Testing
editBoth 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
editOnly basic eyeball testing has been performed:
- standard view/edit/preview/save cycles, for wikitext, CSS and JavaScript.
Search
editBasic 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
editapi.php
editSeveral 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
editExport/Import
editExport 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
editThis is pending, with no defined behavior for non-text content.
Extensions using Content
editSeveral extensions may be affected by the ContentHandler logic, but this has not been surveyed or tested yet:
ExpandTemplates
editMWSearch
editSyntaxHighlight
editThe 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
editCollection
editAntiBot
editAbuse Filter
editSimpleAntiSpam
editSpamBlacklist
editOther Extensions
editSome other extensions may be affected by the refactoring of WikiPage, Article, EditPage, etc.
A survey of which extensions use now-deprecated hooks is pending.