File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/Illuminate/Foundation/Testing Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -85,12 +85,30 @@ protected function refreshTestDatabase()
8585
8686 $ this ->app [Kernel::class]->setArtisan (null );
8787
88+ $ this ->updateLocalCacheOfInMemoryDatabases ();
89+
8890 RefreshDatabaseState::$ migrated = true ;
8991 }
9092
9193 $ this ->beginDatabaseTransaction ();
9294 }
9395
96+ /**
97+ * Update locally cached in-memory PDO connections after migration.
98+ *
99+ * @return void
100+ */
101+ protected function updateLocalCacheOfInMemoryDatabases ()
102+ {
103+ $ database = $ this ->app ->make ('db ' );
104+
105+ foreach ($ this ->connectionsToTransact () as $ name ) {
106+ if ($ this ->usingInMemoryDatabase ($ name )) {
107+ RefreshDatabaseState::$ inMemoryConnections [$ name ] = $ database ->connection ($ name )->getPdo ();
108+ }
109+ }
110+ }
111+
94112 /**
95113 * Migrate the database.
96114 *
You can’t perform that action at this time.
0 commit comments