wiki.techinc.nl/tests/phpunit
2019-10-05 13:57:02 +00:00
..
data Fix XMP parser errors due to trailing nullchar 2019-09-11 22:34:33 +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 "Cleanup of old PHPUnit usage, part 3" 2019-10-05 13:57:02 +00:00
integration/includes/db Type hint against IResultWrapper 2019-10-04 19:58:19 +02:00
languages tests: Prefer PHPUnit's assertSame() when comparing empty strings 2019-09-20 15:27:58 +00:00
maintenance HHVM removal: Kill HHVM_VERSION checks in PHPUnit tests 2019-10-03 15:35:21 +00:00
mocks Hard deprecate new SearchResult() and introduce RevisionSearchResult 2019-08-27 08:27:28 -07:00
skins Add @coversNothing for left over tests and enable sniff 2019-02-02 21:53:40 -08:00
structure tests: Replace PHPUnit's loose assertEquals(false) with assertFalse() 2019-10-04 00:30:36 +00:00
suites phpunit: Don't bother resetting unused global in UploadFromUrlTestSuite 2019-08-31 15:01:18 +01:00
tests Remove unneeded overrideMwServices/resetServices 2019-08-29 14:26:18 +03:00
unit/includes Cleanup of old PHPUnit usage, part 3 2019-10-05 00:00:45 -07:00
bootstrap.maintenance.php Define unit and integration test suites 2019-06-28 12:18:18 -04:00
bootstrap.php phpunit: Repair GLOBALS reset in MediaWikiUnitTestCase 2019-09-02 20:58:34 +01: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 tests: Prefer PHPUnit's assertSame() when comparing empty strings 2019-09-20 15:27:58 +00:00
MediaWikiGroupValidator.php Move trivially compatible tests to the unit tests suite 2019-06-30 15:23:53 +02:00
MediaWikiIntegrationTestCase.php MWTestCase: include table prefix in domain for temp table only mode. 2019-09-27 13:10:22 +02:00
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 Add hooks to MediaWikiPHPUnitTestListener start/endTest 2018-09-10 10:44:24 +00:00
MediaWikiTestCaseTrait.php Add assertFileContains to MediaWikiTestCaseTrait 2019-09-17 17:24:33 +02: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 HHVM removal: Kill HHVM_VERSION checks in PHPUnit tests 2019-10-03 15:35:21 +00:00
phpunit.php phpunit: Repair GLOBALS reset in MediaWikiUnitTestCase 2019-09-02 20:58:34 +01:00
PHPUnit4And6Compat.php PHPUnit4And6Compat tweaks 2019-10-04 19:28:38 -07:00
README Tests: Remove old TODO file and update README with integration notes 2019-07-17 13:00:54 -04:00
ResourceLoaderTestCase.php resourceloader: Reduce width of module hash from 7 chars to 5 2019-09-02 01:25:48 +00:00
run-tests.bat
suite.xml Define unit and integration test suites 2019-06-28 12:18:18 -04: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