wiki.techinc.nl/tests/phpunit
Tim Starling 3d7365e844 Allow new style hook handlers to abort
Aborting was apparently lost by accident in PS28 of the HookContainer
commit.

In the test, to allow multiple different hooks to be registered, I
used a real ObjectFactory with a fake ServiceContainer, instead of a
fake ObjectFactory. I changed the parameter to
getMockExtensionRegistry() to take the full attribute value instead of
the hook name and a single handler.

Change-Id: I7b4c547737febe81a487fe154db150055ae31344
2020-05-01 08:02:31 +10:00
..
data Merge "build: Provide linting for .vue files from upstream" 2020-04-16 01:11:55 +00:00
docs
documentation Update all use of $wgVersion to MW_VERSION 2020-02-25 02:16:12 +00:00
includes Fix DeprecatedHooks and move emitDeprecatedHookWarnings to HookContainer 2020-05-01 08:02:25 +10:00
integration/includes poolcounter: Call poolCounter->release on exception and add tests for PoolCounterWork 2020-04-10 12:51:25 +03:00
languages LanguageConverterTest: Reduce direct references to $wgUser 2020-04-12 18:27:10 +00:00
maintenance PageDumpTestDataTrait: Pass a user to WikiPage::doDeleteArticleReal 2020-04-16 17:03:54 +00:00
mocks api: Wrap getParserOutput by PoolCounterWork in ApiParse module 2020-04-08 22:14:14 +03:00
skins Use MediaWikiServices::getMessageCache 2020-03-14 14:25:03 +01:00
structure phpunit: Add structure test for suite.xml registering all test suites 2020-04-02 01:47:48 +00:00
suites Hide deprecated warnings for Hooks::clear() 2020-04-14 19:28:50 +00:00
tests phpunit: Mock wgDebugToolbar in MediaWikiTestCaseTest 2020-04-08 15:55:15 +01:00
unit Allow new style hook handlers to abort 2020-05-01 08:02:31 +10:00
bootstrap.maintenance.php
bootstrap.php Call TestSetup::applyInitialConfig() from bootstrap.php 2020-04-21 23:40:23 +00:00
HamcrestPHPUnitIntegration.php
LessFileCompilationTest.php resourceloader: Separate style processing from style file loading 2020-02-12 20:23:24 +00:00
Makefile
MediaWikiCliOptions.php Fix broken running tests locally in IDE 2019-11-21 16:28:12 +00:00
MediaWikiCoversValidator.php phpunit: Speed up MediaWikiCoversValidator trait 2020-03-08 18:51:38 +00:00
MediaWikiGroupValidator.php
MediaWikiIntegrationTestCase.php More flexible deprecation warnings 2020-04-22 12:37:22 +10:00
MediaWikiLangTestCase.php Use MediaWikiServices::getMessageCache 2020-03-14 14:25:03 +01: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
MediaWikiPHPUnitTestListener.php Upgrade PHPUnit to version 7 2019-11-20 21:02:33 -08:00
MediaWikiTestCaseTrait.php More flexible deprecation warnings 2020-04-22 12:37:22 +10:00
MediaWikiUnitTestCase.php Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse 2020-01-10 09:32:25 -08:00
phpunit.php Use class keyword for classname resolution 2020-03-27 09:33:01 +01:00
PHPUnit4And6Compat.php
PHPUnit6And8Compat.php phpunit: Remove 6And8Compat trait from base classes 2019-11-21 17:42:39 +00:00
README
ResourceLoaderTestCase.php resourceloader: Export ResourceModuleSkinStyles as extension attribute 2020-03-30 16:08:00 -07:00
run-tests.bat
suite.xml phpunit: Consider "risky" tests as failed tests 2020-04-06 18:05:50 +00: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