Skip to content
Mitsuru Mutaguchi edited this page Feb 21, 2024 · 10 revisions

phpunitは、テストツールです。

前作業

  1. Connect-CMSの最新版にアップデートする
  2. 開発ライブラリ(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実行(下記パス指定は例です。任意に変更してください)
composer phpunit -- -v tests\Unit\Migration\MigrationTraitTest.php

artisanコマンドでphpunit実行

// プロジェクトルートへ移動
cd /path/to/connect-cms

// artisanコマンドでphpunit実行
php artisan test

// artisanコマンドで任意のファイルのphpunit実行(下記パス指定は例です。任意に変更してください)
php artisan test tests\Unit\Migration\MigrationTraitTest.php

// artisanコマンドで任意のディレクトリをまとめてphpunit実行(下記パス指定は例です。任意に変更してください)
php artisan test tests\Unit\Migration\

テストケースディレクトリ

参考リンク

Clone this wiki locally