* Database config is juggled so the value can be restored when
* parallel testing are used, where multiple databases exist.
*/
* Database config is juggled so the value can be restored when
* parallel testing are used, where multiple databases exist.
*/
- protected function runWithEnv(string $name, $value, callable $callback)
+ protected function runWithEnv(string $name, $value, callable $callback, bool $handleDatabase = true)
- DB::purge();
- config()->set('database.connections.mysql_testing.database', $database);
- DB::beginTransaction();
+ if ($handleDatabase) {
+ DB::purge();
+ config()->set('database.connections.mysql_testing.database', $database);
+ DB::beginTransaction();
+ }
- $detailsToCheck['entity_type'] = $entity->getMorphClass();
- $detailsToCheck['entity_id'] = $entity->id;
+ $detailsToCheck['loggable_type'] = $entity->getMorphClass();
+ $detailsToCheck['loggable_id'] = $entity->id;