wiki.techinc.nl/tests/phpunit
Holger Knust f60d04d3ea resourceloader: Add test to validate existence of ImageModule "images" files
New data provider and test method were added to ensure file paths are correct and the file is present.

Bug: T231430
Change-Id: Iadafe0df1104de8829ea87632d65b3008cf80d76
2020-02-12 14:04:33 +00:00
..
data TemplateParserTest: Add test case with syntax error 2020-01-29 23:15:53 +00: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 "Add more tests for the User class" 2020-02-11 18:01:17 +00:00
integration/includes Merge "Coding style: Auto-fix MediaWiki.Usage.PHPUnit*" 2020-01-10 16:59:11 +00:00
languages languages: Decrease visibility of public variables in LanguageConverter class 2020-02-04 16:53:15 +02:00
maintenance Merge "Fix TextPassDumperDatabaseTest to work with 0.11 schema" 2020-02-03 19:50:18 +00:00
mocks Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse 2020-01-10 09:32:25 -08:00
skins tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
structure resourceloader: Add test to validate existence of ImageModule "images" files 2020-02-12 14:04:33 +00:00
suites Remove Preprocessor_DOM, deprecated in 1.34 2020-01-25 11:22:45 -05:00
tests Backwards-compatible PHPUnit 8 preparations 2019-11-02 12:40:07 -07:00
unit Merge "Use ObjectFactory to construct ContentHandlers" 2020-02-11 17:57:14 +00:00
bootstrap.maintenance.php Update tests to use PHPUnit 6 class names 2019-10-06 01:01:28 -07:00
bootstrap.php Allow specifying autoloaded classes for tests 2019-12-10 21:39:30 +00:00
HamcrestPHPUnitIntegration.php Add missing @param and @return to documentation 2019-11-16 13:45:55 +01:00
LessFileCompilationTest.php Replace complicated assertions with assertIsString() and such 2020-01-28 19:17:58 +00:00
Makefile
MediaWikiCliOptions.php Fix broken running tests locally in IDE 2019-11-21 16:28:12 +00:00
MediaWikiCoversValidator.php Rewrite MediaWikiCoversValidator to use @dataProvider 2019-11-27 09:16:57 +00:00
MediaWikiGroupValidator.php Move trivially compatible tests to the unit tests suite 2019-06-30 15:23:53 +02:00
MediaWikiIntegrationTestCase.php MediaWikiIntegrationTestCase: Hard-deprecate assertType() 2020-01-20 12:39:15 +00:00
MediaWikiLangTestCase.php tests: Add explicit return type void to setUp() and tearDown() 2019-10-30 14:31:22 -07:00
MediaWikiLoggerPHPUnitTestListener.php Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse 2020-01-10 09:32:25 -08:00
MediaWikiPHPUnitCommand.php Show the PHPUnit help in phpunit.php --help 2019-11-25 17:19:20 +11:00
MediaWikiPHPUnitResultPrinter.php Backwards-compatible PHPUnit 8 preparations 2019-11-02 12:40:07 -07:00
MediaWikiPHPUnitTestListener.php Upgrade PHPUnit to version 7 2019-11-20 21:02:33 -08:00
MediaWikiTestCaseTrait.php Share assertArrayEquals with MediaWikiUnitTestCase 2020-01-07 16:05:40 -08:00
MediaWikiUnitTestCase.php Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse 2020-01-10 09:32:25 -08:00
phpunit.php phpunit: fix parameter mangling 2020-01-23 18:02:53 +01:00
PHPUnit4And6Compat.php PHPUnit4And6Compat tweaks 2019-10-04 19:28:38 -07:00
PHPUnit6And8Compat.php phpunit: Remove 6And8Compat trait from base classes 2019-11-21 17:42:39 +00:00
README Tests: Remove old TODO file and update README with integration notes 2019-07-17 13:00:54 -04:00
ResourceLoaderTestCase.php Add missing @param and @return to documentation 2019-11-16 13:45:55 +01:00
run-tests.bat
suite.xml phpunit: Drop unused enforceTimeLimit command and related settings 2020-01-22 14:12:45 -08:00

== MediaWiki PHPUnit Tests ==

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


=== WARNING ===

Some of the integration 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