wiki.techinc.nl/tests/phpunit
daniel 0dc7ba02b4 Apply content wrapping in ParserOutput::getText()
Instead of applying wrapping the the parser and unwrapping in
ParserOutput::getText(), turn this around and apply wrapping in getText(),
and only if desired.

This avoids search&replace logic for unwrapping, and it also makes it a lot
easier to merge the output of multiple slots for MCR output.

This changes behavior in two hopefully irrelevant ways:
1) the limit report comments will be inside the wrapper div, instead of
following it.
2) if HTML with a wrapper div is explicitly injected into a ParserOutput
object, it will not be possible to unwrap the text.

Bug: T174035
Change-Id: I1641b7995af9bd297f1acd610d583fbf874f34e0
2018-08-29 16:46:25 +02:00
..
data Fix handling categorization changes 2018-08-14 00:40:08 +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 Apply content wrapping in ParserOutput::getText() 2018-08-29 16:46:25 +02:00
languages languages: Add coverage for 'ar' and 'ml' normalize() 2018-08-14 23:19:35 +00:00
maintenance Fix handling categorization changes 2018-08-14 00:40:08 +00:00
mocks Unify SearchEngine normalizeNamespace and parseNamespacePrefixes 2018-07-17 21:56:05 +00:00
skins
structure Merge "test: Assert that API generators have unique prefixes" 2018-08-18 01:04:31 +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
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
MediaWikiPHPUnitTestListener.php
MediaWikiTestCase.php Merge "Make SpecialPageFactory a service" 2018-08-17 18:53:27 +00:00
phpunit.php Make maintenance scripts fail on unknown parameters 2018-08-06 14:37:49 -05: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