Skip to content

Commit

Permalink
Ensure DBAL custom type doesn't exists (#35704)
Browse files Browse the repository at this point in the history
As the DBAL type registry is a static singleton, when running multiple tests, type may be already registered.
  • Loading branch information
shaffe-fr committed Dec 23, 2020
1 parent ca39a57 commit 843f8bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Database/DatabaseServiceProvider.php
Expand Up @@ -123,7 +123,9 @@ protected function registerDoctrineTypes()
$types = $this->app['config']->get('database.dbal.types', []);

foreach ($types as $name => $class) {
Type::addType($name, $class);
if (! Type::hasType($name)) {
Type::addType($name, $class);
}
}
}
}

0 comments on commit 843f8bb

Please sign in to comment.