Handbuch:PHP-Unit-Tests

From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:PHP unit testing and the translation is 50% complete.
Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎français • ‎português • ‎português do Brasil • ‎中文 • ‎日本語
MediaWiki Flower
« Unit testing
PHPUnit testing

Einführung

Wir führen Unit-Tests der MediaWiki's PHP-Code-Basis mit dem PHPUnit-Framework durch.

Sehen Sie sich unsere Testabdeckung an.

MediaWiki core's PHP unit and integration tests are in the tests/phpunit directory. When adding new tests, unit tests should be placed in tests/phpunit/unit and integration tests should be placed in tests/phpunit/integration The directory structure roughly matches that of the code being tested. For example: you can find the unit tests for file includes/libs/JavaScriptMinifier.php in tests/phpunit/unit/includes/libs/JavaScriptMinifierTest.php.

Extensions should have PHPUnit tests in a tests/phpunit subdirectory, using subdirectories to separate unit and integration tests, e.g. extensions/{extensionName}/tests/phpunit/unit and extensions/{extensionName}/tests/phpunit/integration.

Use the navigation table or the links below to browse through this manual.

Inhalte