wiki.techinc.nl/tests/phpunit
Brian Wolff 97c992eb5d Add object-src 'none' to MW CSP directive (configurable)
<object> and <embed> are from a mostly bygone era. They often can
be used to evade CSP rules, and are often a soft spot for browser
security.

The default value of 'none', disables <object>, <embed>. In some
browsers this will also disable loading some file formats like
pdf directly in an iframe.

The only use I am aware of is in TimedMediaHandler. However, it seems
like the mw.EmbedPlayerGeneric, mw.EmbedPlayerKplayer, and
mw.EmbedPlayerVlc.js are no longer used.

Bug: T239051
Change-Id: Iae7ab1f5b7c422803782848c787bc1a4c6339913
2020-02-18 16:20:56 -08:00
..
data TemplateParserTest: Add test case with syntax error 2020-01-29 23:15:53 +00:00
docs
documentation
includes Add object-src 'none' to MW CSP directive (configurable) 2020-02-18 16:20:56 -08:00
integration/includes Merge "Coding style: Auto-fix MediaWiki.Usage.PHPUnit*" 2020-01-10 16:59:11 +00:00
languages Remove LanguageConverter dependencies on Title and use LinkTarget 2020-02-12 18:37:11 +03:00
maintenance Merge "Fix TextPassDumperDatabaseTest to work with 0.11 schema" 2020-02-03 19:50:18 +00:00
mocks Remove LanguageConverter dependencies on Title and use LinkTarget 2020-02-12 18:37:11 +03:00
skins
structure Remove usages of deprecated Language methods 2020-02-16 00:45:48 +00:00
suites Remove Preprocessor_DOM, deprecated in 1.34 2020-01-25 11:22:45 -05:00
tests
unit Merge "Use ObjectFactory to construct ContentHandlers" 2020-02-11 17:57:14 +00:00
bootstrap.maintenance.php
bootstrap.php
HamcrestPHPUnitIntegration.php
LessFileCompilationTest.php resourceloader: Separate style processing from style file loading 2020-02-12 20:23:24 +00:00
Makefile
MediaWikiCliOptions.php
MediaWikiCoversValidator.php
MediaWikiGroupValidator.php
MediaWikiIntegrationTestCase.php MediaWikiIntegrationTestCase: Hard-deprecate assertType() 2020-01-20 12:39:15 +00:00
MediaWikiLangTestCase.php
MediaWikiLoggerPHPUnitTestListener.php Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse 2020-01-10 09:32:25 -08:00
MediaWikiPHPUnitCommand.php
MediaWikiPHPUnitResultPrinter.php
MediaWikiPHPUnitTestListener.php
MediaWikiTestCaseTrait.php Improve phpdoc in MediaWikiTestCaseTrait 2020-02-11 14:13:25 -08:00
MediaWikiUnitTestCase.php Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse 2020-01-10 09:32:25 -08:00
phpunit.php phpunit: fix parameter mangling 2020-01-23 18:02:53 +01:00
PHPUnit4And6Compat.php
PHPUnit6And8Compat.php
README
ResourceLoaderTestCase.php
run-tests.bat
suite.xml phpunit: Drop unused enforceTimeLimit command and related settings 2020-01-22 14:12:45 -08: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