wiki.techinc.nl/tests/phpunit
Aryeh Gregor 5bbcaef231 FileJournal tests
100% unit test coverage for FileJournal and NullFileJournal. 100%
integration test coverage for DBFileJournal. Unit tests for
DBFileJournal once it supports injection.

I removed FileJournal and NullFileJournal from the list of classes that
FileBackendTest tests. It doesn't actually test them, it just happens to
run code from them without checking its correctness at all.

Depends-On: Ic22075bb5e81b7c2c4c1b8647547aa55306a10a7
Change-Id: I46d10ab7b87c23937aa04d7ec1922abfcf3bd611
2019-09-03 10:12:41 +00:00
..
data Fix categories detele SPARQL clause 2019-08-27 16:19:31 -07:00
docs
documentation tests: Use a fancy generator provider in ReleaseNotesTest 2019-07-02 19:49:43 +01:00
includes FileJournal tests 2019-09-03 10:12:41 +00:00
integration/includes/db Tests: Set dbname for DatabaseSqliteTest 2019-08-20 11:28:29 +02:00
languages Integration tests for Language fallback methods 2019-08-29 18:25:12 +03:00
maintenance Clean up spacing of doc comments 2019-08-05 22:29:50 +00:00
mocks Hard deprecate new SearchResult() and introduce RevisionSearchResult 2019-08-27 08:27:28 -07:00
skins
structure Move User::getAllRights to PermissionManager. 2019-08-29 15:38:26 +02:00
suites phpunit: Don't bother resetting unused global in UploadFromUrlTestSuite 2019-08-31 15:01:18 +01:00
tests Remove unneeded overrideMwServices/resetServices 2019-08-29 14:26:18 +03:00
unit/includes FileJournal tests 2019-09-03 10:12:41 +00:00
bootstrap.maintenance.php Define unit and integration test suites 2019-06-28 12:18:18 -04:00
bootstrap.php Tests: Allow vendor/bin/phpunit from within extension directory 2019-08-14 10:30:25 +02:00
HamcrestPHPUnitIntegration.php
LessFileCompilationTest.php
Makefile docs: Remove 'code-coverage' placeholder directory 2019-01-25 18:35:46 -08:00
MediaWikiCoversValidator.php phpunit: Avoid get_class() in MediaWikiCoversValidator 2019-07-25 22:40:58 +00:00
MediaWikiGroupValidator.php Move trivially compatible tests to the unit tests suite 2019-06-30 15:23:53 +02:00
MediaWikiIntegrationTestCase.php FileJournal tests 2019-09-03 10:12:41 +00:00
MediaWikiLangTestCase.php
MediaWikiLoggerPHPUnitTestListener.php
MediaWikiPHPUnitCommand.php
MediaWikiPHPUnitResultPrinter.php
MediaWikiPHPUnitTestListener.php
MediaWikiTestCaseTrait.php createNoOpMock() method for PHPUnit tests 2019-08-29 18:00:37 +03:00
MediaWikiTestResult.php
MediaWikiTestRunner.php
MediaWikiUnitTestCase.php Add UnknownContentHandler. 2019-08-29 10:43:11 +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 Define unit and integration test suites 2019-06-28 12:18:18 -04: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