Phpunit - opensource-workshop/connect-cms GitHub Wiki
phpunitは、テストツールです。
前作業
phpunit実行
// プロジェクトルートへ移動
cd /path/to/connect-cms
// phpunit実行
./vendor/bin/phpunit
composerコマンドでphpunit実行(上記と同等)
// プロジェクトルートへ移動
cd /path/to/connect-cms
// composerコマンドでphpunit実行
composer phpunit
// or
php composer.phar phpunit
// composerコマンドで任意のファイルでphpunit実行(下記パス指定は例です。任意に変更してください)
// (windowsの場合)
composer phpunit -- tests\Unit\Migration\MigrationTraitTest.php
// (linuxの場合)
composer phpunit -- tests/Unit/Migration/MigrationTraitTest.php
artisanコマンドでphpunit実行
// プロジェクトルートへ移動
cd /path/to/connect-cms
// artisanコマンドでphpunit実行
php artisan test
// artisanコマンドで任意のファイルのphpunit実行(下記パス指定は例です。任意に変更してください)
// (windowsの場合)
php artisan test tests\Unit\Migration\MigrationTraitTest.php
// (linuxの場合)
php artisan test tests/Unit/Migration/MigrationTraitTest.php
// artisanコマンドで任意のディレクトリをまとめてphpunit実行(下記パス指定は例です。任意に変更してください)
// (windowsの場合)
php artisan test tests\Unit\Migration\
// (linuxの場合)
php artisan test tests/Unit/Migration/
テストケースディレクトリ
- tests/Unit ユニット(Unit)テスト
- tests/Feature 機能(Feature)テスト