[Laravel] Controllerをphpunitする時に使うassertion一覧

カテゴリ: 未分類

レスポンスステータスが正しいこと

use Illuminate\Http\Response;

$response = $this->getAjax($path);

$response->assertStatus(Response::HTTP_OK);

Jsonの構造が一致していること

$response = $this->getAjax($path);

$expected = [
    'status' => 'ok',
];
$response->assertExactJson($expected);

Amazonでおトクに買い物する方法
AmazonチャージでポイントGET


Amazonは買いもの前にAmazonギフト券をチャージしてポイントをゲットしないと損!

こちらもおススメ

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です