wiki.techinc.nl/tests/phpunit
Amir Sarabadani e88601918d Make RouterTest extend MediawikiUnitTestCase and not integration
it's in unit directory, it causes things to break

Change-Id: Ibeafafde5a3b9f3f8e6fda0ceef8575aa544e20b
2019-07-10 18:49:23 +02: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 tests: Use a fancy generator provider in ReleaseNotesTest 2019-07-02 19:49:43 +01:00
includes Merge "bagostuff: optimize SqlBagOStuff and fix failing segmentation tests" 2019-07-10 16:34:47 +00:00
integration/includes/db Define unit and integration test suites 2019-06-28 12:18:18 -04:00
languages Unset all globals unneeded for unit tests, assert correct directory 2019-07-09 14:09:29 -04:00
maintenance Add support for xml dump schema 0.11 2019-06-27 21:56:01 +00: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 Run SpecialPageFatalTest with lang=qqx 2019-07-08 14:52:06 +02:00
suites Add missing newline between <?php and namespace/use section 2019-06-03 13:36:48 +00:00
tests Merge "rdbms: clean up $groups logic in LoadBalancer and expand comments" 2019-07-05 22:00:09 +00:00
unit Make RouterTest extend MediawikiUnitTestCase and not integration 2019-07-10 18:49:23 +02:00
bootstrap.maintenance.php Define unit and integration test suites 2019-06-28 12:18:18 -04:00
bootstrap.php Unit tests: Support unit tests in extensions and skins 2019-07-01 16:21:01 -04: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 Verify that all @covers tags are sane when running tests 2017-12-29 20:19:12 +00:00
MediaWikiGroupValidator.php Move trivially compatible tests to the unit tests suite 2019-06-30 15:23:53 +02:00
MediaWikiIntegrationTestCase.php Assert that LocalSettings file exists 2019-07-02 11:57:00 -04:00
MediaWikiLangTestCase.php Mass conversion of $wgContLang to service 2018-08-11 22:44:29 -06:00
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 Add hooks to MediaWikiPHPUnitTestListener start/endTest 2018-09-10 10:44:24 +00:00
MediaWikiTestResult.php Make phpunit.php less hackish, and install the listener unconditionally 2018-09-04 15:30:20 +10:00
MediaWikiTestRunner.php Make phpunit.php less hackish, and install the listener unconditionally 2018-09-04 15:30:20 +10:00
MediaWikiUnitTestCase.php Unset all globals unneeded for unit tests, assert correct directory 2019-07-09 14:09:29 -04:00
phpunit.php Output only to stderr in unit tests 2018-10-08 21:04:12 +03:00
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 Define unit and integration test suites 2019-06-28 12:18:18 -04: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