LoginSignup
0
0

More than 1 year has passed since last update.

[Laravel] テスト中のエラー 'SAVEPOINT trans2 does not exist'

Posted at

laravel 8.75にて

エラー

コマンドテスト中の一幕。

コマンド画面にて突如現れしエラー。
SQLSTATE[42000]: Syntax error or access violation: 1305 SAVEPOINT trans2 does not exist

testerr.jpg

テストを書いてただけなのに......

解決?

テストファイルのuse RefreshDatabase;コードを削除した。
(画像は削除する前)
testerr-2.jpg

Commandファイルでもトランザクション処理を書いていたので、use RefreshDatabase内の処理と重複してしまったようだ。

ていうかuse RefreshDatabaseの内部ってただのTransactionなのか......?

ちょっと面倒だけど、モデル::truncate()を使えばまあ困りはしないので一応解決。

0
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
0
0