Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

Laravel 4 でデータベースを使ったテストを書く際の Tips です。 自動テストでデータベースにアクセステストを書く際に大切なのが、データベーステーブルのデータをテストで想定された状態にしておくということです。テーブルの内容がテストを実行される度に異なると、ある時はテストが通って、ある時は通らないという状態になります。 この「想定された状態」をセットアップするために、フレームワークで用意されている Migration と Seeder を利用しています。 テストケースでマイグレーション実行 開発を進めていると、データベーススキーマを変更する場合があります。マイグレーションファイルを作成して、php artisan migrate コマンドで適用するのことになります。テスト用データベースについても適用する必要がありますが、php artisan migrate --env=testi
Many developers who use Laravel are probably only barely scratching the surface of what the framework has to offer. While the documentation does cover the most common use cases and the obvious features, it doesn’t cover everything. Don’t get me wrong, the documentation is fine, it’s just that there’s so much you can do, it’s hard to document everything. Because of that, we're going to take a look
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く