wiki.techinc.nl/tests/phpunit
Kunal Mehta fb73286fba Add PasswordFactory to MediaWikiServices
Instead of having basically every caller do:
 $pf = new PasswordFactory();
 $pf->init( RequestContext::getMain()->getConfig() );
Just create a single PasswordFactory via MediaWikiServices and pass that
around. Things that want to use their own config can still pass settings
via the new constructor.

This will eventually let us remove the init() function, removing the
only hard dependency upon MediaWiki, to make it easier to librarize
(T89742).

Change-Id: I0fc7520dc023b11a7fa66083eff7b88ebfe49c7b
2018-08-02 14:46:35 +01:00
..
data registration: Validate no duplicate keys exist in extension.json 2018-07-18 09:29:43 +00:00
docs
documentation tests: Add a doc test for release notes' existence and line length 2018-07-13 17:10:03 -07:00
includes Add PasswordFactory to MediaWikiServices 2018-08-02 14:46:35 +01:00
languages Automatically reset namespace caches when needed 2018-08-01 16:30:08 +03:00
maintenance Disable PHPUnit tests that fail under postgres 2018-08-01 22:22:15 +00:00
mocks Unify SearchEngine normalizeNamespace and parseNamespacePrefixes 2018-07-17 21:56:05 +00:00
skins
structure Introduce SpecialPageFatalTest 2018-07-31 07:11:48 +00:00
suites Fix test database prefix in ParserTestTopLevelSuite 2018-07-16 16:21:51 +02:00
tests Introduce MediaWikiTestCase::markTestSkippedIfDbType() 2018-08-01 00:19:10 -07:00
autoload.ide.php
bootstrap.php
HamcrestPHPUnitIntegration.php
LessFileCompilationTest.php
Makefile
MediaWikiCoversValidator.php
MediaWikiLangTestCase.php
MediaWikiPHPUnitTestListener.php
MediaWikiTestCase.php Merge "Introduce ContentLanguage service to replace $wgContLang" 2018-08-02 02:52:23 +00:00
phpunit.php
PHPUnit4And6Compat.php
README
ResourceLoaderTestCase.php Simplify PHP by using ?? and ?: 2018-07-10 20:03:17 +00:00
run-tests.bat
suite.xml tests: Add a doc test for release notes' existence and line length 2018-07-13 17:10:03 -07: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