8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CakePHP3にPHPUnitをインストールする

Posted at

#CakePHP3にPHPUnitをインストールする
##前提条件

  • CakePHP3インストール済み/動作確認済み

##PHPUnitをインストール

  • Rootディレクトリに移動
  • composer.jsonがあるのを確認
  • $ composer update これでインストールされる
  • $ vendor/bin/phpunitでインストールされたか確認

##テストケースを作成

  • bakeが便利
  • $ php bin/cake.php bake all User
  • Model Controller View TestCase Fixtureが作成される

##個別にテストを実行

  • $ vendor/bin/phpunit tests/TestCase/Model/Table/UsersTableTest
  • $ vendor/bin/phpunit tests/TestCase/Controller/UsersControllerTest
8
8
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
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?