wiki.techinc.nl/tests/phpunit
James D. Forrester 5cbb90cf67 OutputPage::addScriptFile: Drop silencing invalid paths, deprecated in 1.24
Change-Id: Ia65c70366ab67324ef2a02f9b0e81a6fb7a081cb
2019-06-27 17:22:52 +00:00
..
data Relax HTML sniffing checks on image upload 2019-06-07 14:21:00 -07:00
docs Add @coversNothing for left over tests and enable sniff 2019-02-02 21:53:40 -08:00
documentation Revert "Separate MediaWiki unit and integration tests" 2019-06-13 23:00:08 +00:00
includes OutputPage::addScriptFile: Drop silencing invalid paths, deprecated in 1.24 2019-06-27 17:22:52 +00:00
languages Revert "Separate MediaWiki unit and integration tests" 2019-06-13 23:00:08 +00:00
maintenance Use HTTPS for creativecommons.org 2019-06-14 11:31:38 +02:00
mocks Add missing newline between <?php and namespace/use section 2019-06-03 13:36:48 +00:00
skins Add @coversNothing for left over tests and enable sniff 2019-02-02 21:53:40 -08:00
structure resourceloader: Remove support for raw modules 2019-06-27 00:08:14 +00:00
suites Add missing newline between <?php and namespace/use section 2019-06-03 13:36:48 +00:00
tests Add missing newline between <?php and namespace/use section 2019-06-03 13:36:48 +00:00
unit Introduce separate unit tests PHPUnit configuration 2019-06-18 16:58:34 +02:00
bootstrap.php phpunit: Call 'teardownTestDB' from shutdown instead of destruct. 2019-03-29 19:52:00 +00:00
HamcrestPHPUnitIntegration.php Use splat operator in HamcrestPHPUnitIntegration 2019-02-26 18:52:03 -08:00
LessFileCompilationTest.php Add @coversNothing for left over tests and enable sniff 2019-02-02 21:53:40 -08:00
Makefile docs: Remove 'code-coverage' placeholder directory 2019-01-25 18:35:46 -08:00
MediaWikiCoversValidator.php
MediaWikiLangTestCase.php
MediaWikiLoggerPHPUnitTestListener.php phpunit: Don't include PHPUnitCommand channel in MediaWikiLoggerPHPUnitTestListener 2019-04-07 00:10:16 +01:00
MediaWikiPHPUnitCommand.php Report logs for each individual test failure 2019-03-06 15:13:53 -08:00
MediaWikiPHPUnitResultPrinter.php Report logs for each individual test failure 2019-03-06 15:13:53 -08:00
MediaWikiPHPUnitTestListener.php
MediaWikiTestCase.php Merge "Clarify MediaWikiTestCase::getSchemaOverrides()" 2019-06-14 00:06:06 +00:00
MediaWikiTestResult.php
MediaWikiTestRunner.php
MediaWikiUnitTestCase.php Introduce separate unit tests PHPUnit configuration 2019-06-18 16:58:34 +02:00
phpunit.php
PHPUnit4And6Compat.php Validate the output of the dump scripts. 2019-03-20 22:25:20 +01:00
README
ResourceLoaderTestCase.php resourceloader: Document which FileModule methods use a DB 2019-06-19 23:44:39 +01:00
run-tests.bat
suite.xml Merge "Introduce separate unit tests PHPUnit configuration" 2019-06-18 15:48:54 +00:00
TODO
unit-tests.xml Introduce separate unit tests PHPUnit configuration 2019-06-18 16:58:34 +02:00

== 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