I had a bit of a documentation challenge approaching the problem of
writing phpunit test for extensions, mostly because many of the
extensions do this very differently and the manual did not have any
recommendations.

It appears many extension have custom bootstraping code ( somewhat hacky
path discovery and manual loading of core mediawiki files, and don't
necessarily register their tests in a consistent way.)

I wrote up a short paragraph of what I would recommend here:
http://www.mediawiki.org/wiki/Manual:Unit_testing#Writing_Unit_Test_for_Extensions

If that makes sense, I will try and open up some bugs on the extensions
with custom bootstraping code, and I would recommend we commit an
example test tests/phpunit/suite.extension.xml file for exclusively
running extension tests.

Eventually it would be ideal to be able to 'just test your extension'
from the core bootstraper (ie dynamically generate our suite.xml and
namespace the registration of extension tests) ... but for now at least
not having to wait for all the core tests as you write you extension
tests and some basic documentation on how to do seems like a step forward.

--michael

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to