wiki.techinc.nl/tests/phpunit
Aryeh Gregor 8ec24b607a Introduce MovePageFactory
This will help make MovePage more testable.

In the course of abstracting the logic out of ParserFactoryTest to
FactoryArgTestTrait so it could be used in MovePageFactoryTest, I made
them all unit tests instead of integration. This required some
modification to the Parser constructor so that it didn't access
MediaWikiServices unnecessarily.

Change-Id: Idaa1633f32dfedfa37516bb9180cfcfbe7ca31aa
2019-08-19 20:25:31 +03:00
..
data MimeAnalyzer: fix ZIP parsing failure 2019-07-25 13:40:18 +10:00
docs
documentation
includes Introduce MovePageFactory 2019-08-19 20:25:31 +03:00
integration/includes/db
languages Clean up spacing of doc comments 2019-08-05 22:29:50 +00:00
maintenance Clean up spacing of doc comments 2019-08-05 22:29:50 +00:00
mocks Add ISearchResultSet 2019-07-22 18:27:39 +00:00
skins
structure resourceloader: Remove slow structure test for checking getVersionHash 2019-08-01 15:33:23 +00:00
suites More clean up of oracle/mssql 2019-08-14 17:04:50 +02:00
tests Merge "rdbms: clean up $groups logic in LoadBalancer and expand comments" 2019-07-05 22:00:09 +00:00
unit/includes Introduce MovePageFactory 2019-08-19 20:25:31 +03:00
bootstrap.maintenance.php
bootstrap.php Tests: Allow vendor/bin/phpunit from within extension directory 2019-08-14 10:30:25 +02:00
HamcrestPHPUnitIntegration.php
LessFileCompilationTest.php
Makefile
MediaWikiCoversValidator.php phpunit: Avoid get_class() in MediaWikiCoversValidator 2019-07-25 22:40:58 +00:00
MediaWikiGroupValidator.php
MediaWikiIntegrationTestCase.php Fix doc for MediaWikiIntegrationTestCase::getTestSysop 2019-08-18 11:53:49 +00:00
MediaWikiLangTestCase.php
MediaWikiLoggerPHPUnitTestListener.php
MediaWikiPHPUnitCommand.php
MediaWikiPHPUnitResultPrinter.php
MediaWikiPHPUnitTestListener.php
MediaWikiTestResult.php
MediaWikiTestRunner.php
MediaWikiUnitTestCase.php MediaWikiUnitTestCase: Use DIRECTORY_SEPARATOR instead of / 2019-07-19 19:45:30 +00:00
phpunit.php
PHPUnit4And6Compat.php
README Tests: Remove old TODO file and update README with integration notes 2019-07-17 13:00:54 -04:00
ResourceLoaderTestCase.php resourceloader: Remove use of object registering in test suites 2019-07-12 01:17:44 +00:00
run-tests.bat
suite.xml

== 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