From 9974ce81d2bd9f9c87411d5f49a6bc746729774b Mon Sep 17 00:00:00 2001 From: Karel Faille Date: Wed, 23 Dec 2020 14:27:45 +0100 Subject: [PATCH] Ensure DBAL custom type doesn't exists As the DBAL type registry is a static singleton, when running multiple tests, type may be already registered. --- src/Illuminate/Database/DatabaseServiceProvider.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Database/DatabaseServiceProvider.php b/src/Illuminate/Database/DatabaseServiceProvider.php index 72f131d0db49..9f2ab18503e1 100755 --- a/src/Illuminate/Database/DatabaseServiceProvider.php +++ b/src/Illuminate/Database/DatabaseServiceProvider.php @@ -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); + } } } }