wiki.techinc.nl/tests/phpunit
C. Scott Ananian 36f14abd26 OutputPageTest should be independent of $wgResourceLoaderDebug setting
`OutputPageTest::testMakeResourceLoaderLink()` and
`OutputPageTest::testBuildExemptModules()` tried to force
`$wgResourceLoaderDebug=false` before running the test, but they
neglected to clear the resource loader debug cache
(`ResourceLoader::clearCache()`) so the user's local setting of
`$wgResourceLoaderDebug` would be used despite it all.

Change-Id: I3e7dec762c8a02683fc66a630c950b72a4840a9b
2018-09-25 12:56:40 -04:00
..
data Merge "TemplateParser: Pass FLAG_MUSTACHELOOKUP to enable parent context access" 2018-09-05 00:33:42 +00:00
docs
documentation RELEASE-NOTES: Use New/Changed/Removed pattern for Configuration section 2018-09-01 19:59:30 +00:00
includes OutputPageTest should be independent of $wgResourceLoaderDebug setting 2018-09-25 12:56:40 -04:00
languages languages: Add coverage for 'ar' and 'ml' normalize() 2018-08-14 23:19:35 +00:00
maintenance Schema change for reading ct_tag_id instead of ct_tag 2018-09-04 19:29:48 +02:00
mocks Avoid constructing Title objects in data providers 2018-09-03 16:36:49 +00:00
skins
structure StructureTest::testUnitTestFileNamesEndWithTest() should not shell out 2018-09-18 20:34:28 +02:00
suites Reset services in ParserTestTopLevelSuite. 2018-09-12 19:51:28 +02:00
tests Reset services before every test 2018-09-03 16:38:58 +00:00
bootstrap.php
HamcrestPHPUnitIntegration.php
LessFileCompilationTest.php
Makefile
MediaWikiCoversValidator.php
MediaWikiLangTestCase.php Mass conversion of $wgContLang to service 2018-08-11 22:44:29 -06:00
MediaWikiPHPUnitCommand.php Make phpunit.php less hackish, and install the listener unconditionally 2018-09-04 15:30:20 +10:00
MediaWikiPHPUnitTestListener.php Add hooks to MediaWikiPHPUnitTestListener start/endTest 2018-09-10 10:44:24 +00:00
MediaWikiTestCase.php Ensure database is setup in MediaWikiTestCase::insertPage 2018-09-14 22:32:23 +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
phpunit.php Make phpunit.php less hackish, and install the listener unconditionally 2018-09-04 15:30:20 +10:00
PHPUnit4And6Compat.php
README
ResourceLoaderTestCase.php Simplify PHP by using ?? and ?: 2018-07-10 20:03:17 +00:00
run-tests.bat
suite.xml languages: Add coverage for 'ar' and 'ml' normalize() 2018-08-14 23:19:35 +00: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