wiki.techinc.nl/tests/phpunit
Matthias Mullie d6bc1b2589 Remove test code that depends on extension
And allow extensions to add their own media handlers.

I'm not too happy with the introduction of another global,
but didn't like the alternatives either:
* Add some hook to MockMediaHandlerFactory that would allow
  extensions to add their own stuff in.
* Use another hook (like ParserTestTables or ParserTestGlobals)
  and then override the service with a new instance - seemed
  too hacky
The good thing about this is that it lets us kill off a class.
I'm other to other suggestions in case I missed something.

Bug: T169258
Depends-On: I5875621c58597426ad5242bf3d07714555c439b5
Change-Id: I1c2e903fb235395a8de8e0f7bf65ce07739d2930
2017-08-13 12:04:37 -04:00
..
data Merge "MimeAnalyzer: Add testcases for mp3 detection" 2017-08-09 16:36:23 +00:00
docs
includes Remove test code that depends on extension 2017-08-13 12:04:37 -04:00
languages Add new static function LanguageCode::replaceDeprecatedCodes 2017-08-10 15:21:59 -04:00
maintenance Remove empty lines at begin of function, if, foreach, switch 2017-07-01 11:34:16 +00:00
mocks Remove test code that depends on extension 2017-08-13 12:04:37 -04:00
skins
structure rdbms: Refactor DatabaseTest 2017-07-20 18:23:37 -07:00
suites Autodiscover parser tests for extensions, deprecate $wgParserTestFiles 2017-07-08 00:47:02 +00:00
tests
autoload.ide.php
bootstrap.php
LessFileCompilationTest.php
Makefile
MediaWikiLangTestCase.php
MediaWikiPHPUnitTestListener.php
MediaWikiTestCase.php update mediawiki-codesniffer to 0.11.0 and fix issues 2017-08-11 22:27:51 +02:00
phpunit.php
README
ResourceLoaderTestCase.php resourceloader: Include lessVars in FileModule definition summary 2017-07-27 03:02:09 +00:00
run-tests.bat
suite.xml phpunit: Exclude /languages/messages from coverage report 2017-07-27 21:03:18 -07:00
TODO

== MediaWiki PHPUnit Tests ==

The unit tests for MediaWiki are implemented using the PHPUnit testing
framework and require PHPUnit to run.


=== WARNING ===

Some of the unit tests are DESTRUCTIVE and WILL ALTER YOUR WIKI'S CONTENTS.

DO NOT RUN THESE TESTS ON A PRODUCTION SYSTEM OR ON ANY SYSTEM WHERE YOU NEED
TO RETAIN YOUR DATA.


== Installation ==

If you used composer to install MediaWiki's dependencies PHPUnit will already be available, unless
you explicitly specified the --no-dev flag during the install. In this case just run "composer update".

Otherwise follow the installation instructions in the
PHPUnit Manual at:

  https://phpunit.de/manual/current/en/installation.html


== Running tests ==

The tests are run from your operating system's command line.

Ensure that you are in the tests/phpunit directory of your MediaWiki
installation.


On Unix-like operating systems, the tests runs are controlled with a makefile.
Run command:

  make help

for a full list of options for running tests.


On Windows-family operating systems, run the 'run-tests.bat' batch file.


=== Writing tests ===

A guide to writing PHP unit tests for MediaWiki can be found at:

	https://www.mediawiki.org/wiki/Manual:PHP_unit_testing