wiki.techinc.nl/tests/phpunit
Aaron Schulz fb51330084 rdbms: include client ID hash in ChronologyProtector cookies
Previously, if an internal service forwarded the cookies for a
user (e.g. for permissions) but not the User-Agent header or not
the IP address (e.g. XFF), ChronologyProtector could timeout
waiting for a matching writeIndex to appear for the wrong key.

The cookie now tethers the client to the key that holds the
DB positions from their last state-changing request.

Bug: T194403
Bug: T190082
Change-Id: I84f2cbea82532d911cdfed14644008894498813a
2018-06-02 03:57:30 +00:00
..
data Use wikimedia/xmp-reader library 2018-05-31 19:24:39 -07:00
docs
includes rdbms: include client ID hash in ChronologyProtector cookies 2018-06-02 03:57:30 +00:00
languages Use PHP 5.6 '**' operator instead of 'pow()' function 2018-05-30 18:05:19 -07:00
maintenance Call Database::timestamp in some tests 2018-05-29 22:28:36 +02:00
mocks Fix MockMessageLocalizer 2018-03-29 12:32:00 +02:00
skins Convert HTTP links to MediaWiki.org to HTTPS 2018-04-04 18:36:10 +00:00
structure Don't autoload classes in AutoloadStructureTest 2018-05-29 11:09:57 -07:00
suites Use PHP 5.6 constant expressions for some bitfield constants 2018-05-30 18:05:18 -07:00
tests Allow schema overrides to drop tables. 2018-03-29 21:44:47 +02:00
autoload.ide.php Setup: Deprecate StartProfiler, move default to DefaultSettings 2018-03-29 21:29:03 +00:00
bootstrap.php
HamcrestPHPUnitIntegration.php Add HamcrestPHPUnitIntegration trait 2018-04-12 19:52:05 -07:00
LessFileCompilationTest.php
Makefile
MediaWikiCoversValidator.php Verify that all @covers tags are sane when running tests 2017-12-29 20:19:12 +00:00
MediaWikiLangTestCase.php
MediaWikiPHPUnitTestListener.php build: Updating mediawiki/mediawiki-codesniffer to 16.0.0 2018-02-17 13:29:13 +01:00
MediaWikiTestCase.php Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient 2018-05-30 18:06:13 -07:00
phpunit.php Allow PHPUnit 6 optionally in require-dev 2018-04-12 20:46:56 -07:00
PHPUnit4And6Compat.php tests: Support passing null to setExpectedException() in compat layer 2018-04-15 08:10:35 +00:00
README
ResourceLoaderTestCase.php resourceloader: Apply safemode to startup module registry 2018-05-19 22:14:33 +02:00
run-tests.bat
suite.xml
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