1
0

More than 1 year has passed since last update.

laravel Mockeryを使ってテストを書く(インストール準備編)

Last updated at Posted at 2022-06-27

概要

  • laravelの環境にMockeryをインストールして使えるところまで持っていく方法をメモ的にまとめる。

方法

  1. 下記コマンドを実行してMockeryをcomposerでインストールする。

    $ composer require --dev mockery/mockery
    
  2. composer.jsonを確認し、require-devにMockeryの情報が追記されていれば準備完了である。

    composer.json
    "require-dev": {
        "mockery/mockery": "^1.5",
    }
    
  3. tinkerにて下記を実行し、エラーがでないことを確認する。

    $mock = \Mockery::mock('foo');
    

参考文献

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