Manual:PHP 単体テスト

This page is a translated version of the page Manual:PHP unit testing and the translation is 83% complete.
Outdated translations are marked like this.

はじめに

MediaWiki の PHP コード ベースの単体テストと統合テストを、PHPUnit フレームワークを使用して行います。 MediaWiki コアのテスト カバレッジをご覧ください。

MediaWiki コアの PHP 単体テストと統合テストは tests/phpunit ディレクトリにあります。 When adding new tests, unit tests should be placed in tests/phpunit/unit and integration tests should be placed in tests/phpunit/integration ディレクトリ構造は、テストされるコードのディレクトリ構造とほぼ一致します。 例: ファイル includes/libs/JavaScriptMinifier.php の単体テストは 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.

ナビゲーション表または下記のリンクを使用してこのマニュアルを閲覧してください。

コンテンツ