LoginSignup
1
0

More than 3 years have passed since last update.

【PHP学習メモ】PHPUnitが実行できない時

Posted at

 PHPUnitを実行しようとするとエラーが発生する、ということがありました。
 忘れないように自分用のメモとして残しておきます。

 ※ 今回はこちらの記事を参考にさせて頂きました:relaxed::tulip:
 https://blog-s.xchange.jp/?p=1152

 ・PHPUnitを実行する
 phpunit コマンドを実行してユニットテストを行います。
 phpunitはPHPUnitをインストールしたディレクトリのvendor\binフォルダ配下にシンボリックリンクがあります。

 全てのテストケースの実行、特定のテストケースだけ実行どちらもできます。

 例 )  以下のようなディレクトリ構成で全てのテストケースを実行する場合

src                              tests                        vendor
`-- CoordinatePoint.php          `-- CoordinateTest.php       `-- bin
`-- PeopleCoordinatePoint.php    `-- TyphoonTest.php              `-- phpunit
`-- RadiusPoint.php                       
`-- Typhoon.php

※ 一部省略しております。

 次のコマンドで実行することができます。

vendor/bin/phpunit tests/

■ 注意 ■
 コマンドを実行するディレクトリを確かめましょう。

vendor/bin/phpunit tests/
zsh: no such file or directory: vendor/bin/phpunit

 

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0