diff --git a/composer.json b/composer.json
index 5f77ca6..9cbf604 100644
--- a/composer.json
+++ b/composer.json
@@ -10,8 +10,8 @@
     "license": "MIT",
     "require": {
         "brick/date-time": "~0.6.0 || ~0.7.0",
-        "doctrine/dbal": "^2.7.0 || ^3.0",
-        "doctrine/orm": "^2.7.0",
+        "doctrine/dbal": "^4.0",
+        "doctrine/orm": "^3.0",
         "php": "^8.1"
     },
     "require-dev": {
@@ -20,8 +20,8 @@
         "phpunit/phpunit": "^10.5",
         "php-coveralls/php-coveralls": "^2.4",
         "vimeo/psalm": "5.21.1",
-        "doctrine/annotations": "^1.0",
-        "guzzlehttp/guzzle": "^7.0"
+        "guzzlehttp/guzzle": "^7.0",
+        "symfony/cache": "^5.0 || ^6.0 || ^7.0"
     },
     "autoload": {
         "psr-4": {
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
deleted file mode 100644
index 4725a58..0000000
--- a/psalm-baseline.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<files psalm-version="5.21.1@8c473e2437be8b6a8fd8f630f0f11a16b114c494">
-  <file src="src/Types/DurationType.php">
-    <DeprecatedMethod>
-      <code>getVarcharTypeDeclarationSQL</code>
-    </DeprecatedMethod>
-  </file>
-  <file src="src/Types/PeriodType.php">
-    <DeprecatedMethod>
-      <code>getVarcharTypeDeclarationSQL</code>
-    </DeprecatedMethod>
-  </file>
-</files>
diff --git a/psalm.xml b/psalm.xml
index 9d52591..f19428c 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -5,7 +5,6 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns="https://getpsalm.org/schema/config"
     xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
-    errorBaseline="psalm-baseline.xml"
     findUnusedBaselineEntry="true"
     findUnusedPsalmSuppress="true"
     findUnusedCode="false"
diff --git a/src/Types/DayOfWeekType.php b/src/Types/DayOfWeekType.php
index e78edda..45ae4bf 100644
--- a/src/Types/DayOfWeekType.php
+++ b/src/Types/DayOfWeekType.php
@@ -6,9 +6,11 @@
 
 use Brick\DateTime\DayOfWeek;
 use Doctrine\DBAL\ParameterType;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\InvalidType;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Platforms\AbstractPlatform;
+use ValueError;
 
 /**
  * Doctrine type for DayOfWeek.
@@ -17,17 +19,12 @@
  */
 final class DayOfWeekType extends Type
 {
-    public function getName(): string
-    {
-        return 'DayOfWeek';
-    }
-
     public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
     {
         return $platform->getSmallIntTypeDeclarationSQL($column);
     }
 
-    public function convertToDatabaseValue($value, AbstractPlatform $platform): ?int
+    public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?int
     {
         if ($value === null) {
             return null;
@@ -37,37 +34,33 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?int
             return $value->value;
         }
 
-        throw ConversionException::conversionFailedInvalidType(
+        throw InvalidType::new(
             $value,
-            $this->getName(),
-            [DayOfWeek::class, 'null']
+            static::class,
+            [DayOfWeek::class, 'null'],
         );
     }
 
-    public function convertToPHPValue($value, AbstractPlatform $platform): ?DayOfWeek
+    public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?DayOfWeek
     {
         if ($value === null) {
             return null;
         }
 
-        if (is_int($value)) {
-            return DayOfWeek::from($value);
+        try {
+            return DayOfWeek::from((int) $value);
+        } catch (ValueError $e) {
+            throw ValueNotConvertible::new(
+                $value,
+                DayOfWeek::class,
+                $e->getMessage(),
+                $e,
+            );
         }
-
-        throw ConversionException::conversionFailedInvalidType(
-            $value,
-            $this->getName(),
-            [DayOfWeek::class, 'null']
-        );
     }
 
-    public function getBindingType(): int
+    public function getBindingType(): ParameterType
     {
         return ParameterType::INTEGER;
     }
-
-    public function requiresSQLCommentHint(AbstractPlatform $platform): bool
-    {
-        return true;
-    }
 }
diff --git a/src/Types/DurationType.php b/src/Types/DurationType.php
index a3475e0..5477082 100644
--- a/src/Types/DurationType.php
+++ b/src/Types/DurationType.php
@@ -4,9 +4,11 @@
 
 namespace Brick\DateTime\Doctrine\Types;
 
+use Brick\DateTime\DateTimeException;
 use Brick\DateTime\Duration;
 use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\InvalidType;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
 use Doctrine\DBAL\Types\Type;
 
 /**
@@ -16,21 +18,16 @@
  */
 final class DurationType extends Type
 {
-    public function getName(): string
-    {
-        return 'Duration';
-    }
-
     public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
     {
         if (!isset($column['length'])) {
             $column['length'] = 64;
         }
 
-        return $platform->getVarcharTypeDeclarationSQL($column);
+        return $platform->getStringTypeDeclarationSQL($column);
     }
 
-    public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
+    public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string
     {
         if ($value === null) {
             return null;
@@ -40,24 +37,28 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
             return (string) $value;
         }
 
-        throw ConversionException::conversionFailedInvalidType(
+        throw InvalidType::new(
             $value,
-            $this->getName(),
-            [Duration::class, 'null']
+            static::class,
+            [Duration::class, 'null'],
         );
     }
 
-    public function convertToPHPValue($value, AbstractPlatform $platform): ?Duration
+    public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Duration
     {
         if ($value === null) {
             return null;
         }
 
-        return Duration::parse((string) $value);
-    }
-
-    public function requiresSQLCommentHint(AbstractPlatform $platform): bool
-    {
-        return true;
+        try {
+            return Duration::parse((string) $value);
+        } catch (DateTimeException $e) {
+            throw ValueNotConvertible::new(
+                $value,
+                Duration::class,
+                $e->getMessage(),
+                $e,
+            );
+        }
     }
 }
diff --git a/src/Types/InstantType.php b/src/Types/InstantType.php
index 8299257..90665de 100644
--- a/src/Types/InstantType.php
+++ b/src/Types/InstantType.php
@@ -6,7 +6,7 @@
 
 use Brick\DateTime\Instant;
 use Doctrine\DBAL\ParameterType;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\InvalidType;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Platforms\AbstractPlatform;
 
@@ -17,17 +17,12 @@
  */
 final class InstantType extends Type
 {
-    public function getName(): string
-    {
-        return 'Instant';
-    }
-
     public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
     {
         return $platform->getIntegerTypeDeclarationSQL($column);
     }
 
-    public function convertToDatabaseValue($value, AbstractPlatform $platform): ?int
+    public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?int
     {
         if ($value === null) {
             return null;
@@ -37,14 +32,14 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?int
             return $value->getEpochSecond();
         }
 
-        throw ConversionException::conversionFailedInvalidType(
+        throw InvalidType::new(
             $value,
-            $this->getName(),
-            [Instant::class, 'null']
+            static::class,
+            [Instant::class, 'null'],
         );
     }
 
-    public function convertToPHPValue($value, AbstractPlatform $platform): ?Instant
+    public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Instant
     {
         if ($value === null) {
             return null;
@@ -53,13 +48,8 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?Instant
         return Instant::of((int) $value);
     }
 
-    public function getBindingType(): int
+    public function getBindingType(): ParameterType
     {
         return ParameterType::INTEGER;
     }
-
-    public function requiresSQLCommentHint(AbstractPlatform $platform): bool
-    {
-        return true;
-    }
 }
diff --git a/src/Types/LocalDateTimeType.php b/src/Types/LocalDateTimeType.php
index 8f888bb..8d55eea 100644
--- a/src/Types/LocalDateTimeType.php
+++ b/src/Types/LocalDateTimeType.php
@@ -4,8 +4,10 @@
 
 namespace Brick\DateTime\Doctrine\Types;
 
+use Brick\DateTime\DateTimeException;
 use Brick\DateTime\LocalDateTime;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\InvalidType;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Platforms\AbstractPlatform;
 
@@ -16,17 +18,12 @@
  */
 final class LocalDateTimeType extends Type
 {
-    public function getName(): string
-    {
-        return 'LocalDateTime';
-    }
-
     public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
     {
         return $platform->getDateTimeTypeDeclarationSQL($column);
     }
 
-    public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
+    public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string
     {
         if ($value === null) {
             return null;
@@ -42,14 +39,14 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
             return $stringValue;
         }
 
-        throw ConversionException::conversionFailedInvalidType(
+        throw InvalidType::new(
             $value,
-            $this->getName(),
-            [LocalDateTime::class, 'null']
+            static::class,
+            [LocalDateTime::class, 'null'],
         );
     }
 
-    public function convertToPHPValue($value, AbstractPlatform $platform): ?LocalDateTime
+    public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?LocalDateTime
     {
         if ($value === null) {
             return null;
@@ -57,11 +54,15 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?LocalDat
 
         $value = str_replace(' ', 'T', (string) $value);
 
-        return LocalDateTime::parse($value);
-    }
-
-    public function requiresSQLCommentHint(AbstractPlatform $platform): bool
-    {
-        return true;
+        try {
+            return LocalDateTime::parse($value);
+        } catch (DateTimeException $e) {
+            throw ValueNotConvertible::new(
+                $value,
+                LocalDateTime::class,
+                $e->getMessage(),
+                $e,
+            );
+        }
     }
 }
diff --git a/src/Types/LocalDateType.php b/src/Types/LocalDateType.php
index 642ecb7..d8d0a5d 100644
--- a/src/Types/LocalDateType.php
+++ b/src/Types/LocalDateType.php
@@ -4,8 +4,10 @@
 
 namespace Brick\DateTime\Doctrine\Types;
 
+use Brick\DateTime\DateTimeException;
 use Brick\DateTime\LocalDate;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\InvalidType;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Platforms\AbstractPlatform;
 
@@ -16,17 +18,12 @@
  */
 final class LocalDateType extends Type
 {
-    public function getName(): string
-    {
-        return 'LocalDate';
-    }
-
     public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
     {
         return $platform->getDateTypeDeclarationSQL($column);
     }
 
-    public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
+    public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string
     {
         if ($value === null) {
             return null;
@@ -36,24 +33,28 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
             return (string) $value;
         }
 
-        throw ConversionException::conversionFailedInvalidType(
+        throw InvalidType::new(
             $value,
-            $this->getName(),
-            [LocalDate::class, 'null']
+            static::class,
+            [LocalDate::class, 'null'],
         );
     }
 
-    public function convertToPHPValue($value, AbstractPlatform $platform): ?LocalDate
+    public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?LocalDate
     {
         if ($value === null) {
             return null;
         }
 
-        return LocalDate::parse((string) $value);
-    }
-
-    public function requiresSQLCommentHint(AbstractPlatform $platform): bool
-    {
-        return true;
+        try {
+            return LocalDate::parse((string) $value);
+        } catch (DateTimeException $e) {
+            throw ValueNotConvertible::new(
+                $value,
+                LocalDate::class,
+                $e->getMessage(),
+                $e,
+            );
+        }
     }
 }
diff --git a/src/Types/LocalTimeType.php b/src/Types/LocalTimeType.php
index 0fe593d..a5fe911 100644
--- a/src/Types/LocalTimeType.php
+++ b/src/Types/LocalTimeType.php
@@ -4,8 +4,10 @@
 
 namespace Brick\DateTime\Doctrine\Types;
 
+use Brick\DateTime\DateTimeException;
 use Brick\DateTime\LocalTime;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\InvalidType;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
 use Doctrine\DBAL\Types\Type;
 use Doctrine\DBAL\Platforms\AbstractPlatform;
 
@@ -16,17 +18,12 @@
  */
 final class LocalTimeType extends Type
 {
-    public function getName(): string
-    {
-        return 'LocalTime';
-    }
-
     public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
     {
         return $platform->getTimeTypeDeclarationSQL($column);
     }
 
-    public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
+    public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string
     {
         if ($value === null) {
             return null;
@@ -42,24 +39,28 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
             return $stringValue;
         }
 
-        throw ConversionException::conversionFailedInvalidType(
+        throw InvalidType::new(
             $value,
-            $this->getName(),
-            [LocalTime::class, 'null']
+            static::class,
+            [LocalTime::class, 'null'],
         );
     }
 
-    public function convertToPHPValue($value, AbstractPlatform $platform): ?LocalTime
+    public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?LocalTime
     {
         if ($value === null) {
             return null;
         }
 
-        return LocalTime::parse((string) $value);
-    }
-
-    public function requiresSQLCommentHint(AbstractPlatform $platform): bool
-    {
-        return true;
+        try {
+            return LocalTime::parse((string) $value);
+        } catch (DateTimeException $e) {
+            throw ValueNotConvertible::new(
+                $value,
+                LocalTime::class,
+                $e->getMessage(),
+                $e,
+            );
+        }
     }
 }
diff --git a/src/Types/PeriodType.php b/src/Types/PeriodType.php
index 153e856..295defd 100644
--- a/src/Types/PeriodType.php
+++ b/src/Types/PeriodType.php
@@ -4,9 +4,11 @@
 
 namespace Brick\DateTime\Doctrine\Types;
 
+use Brick\DateTime\DateTimeException;
 use Brick\DateTime\Period;
 use Doctrine\DBAL\Platforms\AbstractPlatform;
-use Doctrine\DBAL\Types\ConversionException;
+use Doctrine\DBAL\Types\Exception\InvalidType;
+use Doctrine\DBAL\Types\Exception\ValueNotConvertible;
 use Doctrine\DBAL\Types\Type;
 
 /**
@@ -16,21 +18,16 @@
  */
 final class PeriodType extends Type
 {
-    public function getName(): string
-    {
-        return 'Period';
-    }
-
     public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
     {
         if (!isset($column['length'])) {
             $column['length'] = 64;
         }
 
-        return $platform->getVarcharTypeDeclarationSQL($column);
+        return $platform->getStringTypeDeclarationSQL($column);
     }
 
-    public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string
+    public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string
     {
         if ($value === null) {
             return null;
@@ -40,24 +37,28 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
             return (string) $value;
         }
 
-        throw ConversionException::conversionFailedInvalidType(
+        throw InvalidType::new(
             $value,
-            $this->getName(),
-            [Period::class, 'null']
+            static::class,
+            [Period::class, 'null'],
         );
     }
 
-    public function convertToPHPValue($value, AbstractPlatform $platform): ?Period
+    public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Period
     {
         if ($value === null) {
             return null;
         }
 
-        return Period::parse((string) $value);
-    }
-
-    public function requiresSQLCommentHint(AbstractPlatform $platform): bool
-    {
-        return true;
+        try {
+            return Period::parse((string) $value);
+        } catch (DateTimeException $e) {
+            throw ValueNotConvertible::new(
+                $value,
+                Period::class,
+                $e->getMessage(),
+                $e,
+            );
+        }
     }
 }
diff --git a/tests/AbstractFunctionalTestCase.php b/tests/AbstractFunctionalTestCase.php
index 0add612..613d69b 100644
--- a/tests/AbstractFunctionalTestCase.php
+++ b/tests/AbstractFunctionalTestCase.php
@@ -7,33 +7,31 @@
 use Brick\DateTime\Doctrine\Tests\Entity\KitchenSink;
 use Doctrine\DBAL\Connection;
 use Doctrine\DBAL\DriverManager;
+use Doctrine\DBAL\Tools\DsnParser;
 use Doctrine\ORM\Configuration;
 use Doctrine\ORM\EntityManager;
+use Doctrine\ORM\ORMSetup;
 use PHPUnit\Framework\TestCase;
 
 abstract class AbstractFunctionalTestCase extends TestCase
 {
     final protected static function createConnection(): Connection
     {
-        return DriverManager::getConnection(['url' => 'sqlite:///:memory:']);
+        $dsnParser = new DsnParser(['sqlite' => 'pdo_sqlite']);
+
+        return DriverManager::getConnection(
+            $dsnParser->parse('sqlite:///:memory:'),
+        );
     }
 
     final protected static function createEntityManager(Connection $connection): EntityManager
     {
-        return EntityManager::create($connection, self::createConfiguration());
+        return new EntityManager($connection, self::createConfiguration());
     }
 
     private static function createConfiguration(): Configuration
     {
-        $config = new Configuration();
-
-        $driverImpl = $config->newDefaultAnnotationDriver([__DIR__ . '/tests/Entity'], false);
-        $config->setMetadataDriverImpl($driverImpl);
-
-        $config->setProxyDir(sys_get_temp_dir());
-        $config->setProxyNamespace('Brick\DateTime\Doctrine\Tests\Proxy');
-
-        return $config;
+        return ORMSetup::createAttributeMetadataConfiguration([__DIR__ . '/tests/Entity']);
     }
 
     final protected static function truncateEntityTable(EntityManager $em): void
diff --git a/tests/Entity/KitchenSink.php b/tests/Entity/KitchenSink.php
index de35716..c8036ae 100644
--- a/tests/Entity/KitchenSink.php
+++ b/tests/Entity/KitchenSink.php
@@ -13,66 +13,32 @@
 use Brick\DateTime\Period;
 use Doctrine\ORM\Mapping as ORM;
 
-/**
- * @ORM\Entity
- */
+#[ORM\Entity]
 class KitchenSink
 {
-    /**
-     * @ORM\Id
-     * @ORM\Column(type="integer")
-     * @ORM\GeneratedValue
-     *
-     * @var int
-     */
-    public $id;
+    #[ORM\Id]
+    #[ORM\Column(type: 'integer')]
+    #[ORM\GeneratedValue]
+    public int $id;
 
-    /**
-     * @ORM\Column(type="DayOfWeek", nullable=true)
-     *
-     * @var DayOfWeek|null
-     */
-    public $dayOfWeek = null;
+    #[ORM\Column(type: 'DayOfWeek', nullable: true)]
+    public ?DayOfWeek $dayOfWeek = null;
 
-    /**
-     * @ORM\Column(type="Instant", nullable=true)
-     *
-     * @var Instant|null
-     */
-    public $instant = null;
+    #[ORM\Column(type: 'Instant', nullable: true)]
+    public ?Instant $instant = null;
 
-    /**
-     * @ORM\Column(type="LocalDate", nullable=true)
-     *
-     * @var LocalDate|null
-     */
-    public $localDate = null;
+    #[ORM\Column(type: 'LocalDate', nullable: true)]
+    public ?LocalDate $localDate = null;
 
-    /**
-     * @ORM\Column(type="LocalTime", nullable=true)
-     *
-     * @var LocalTime|null
-     */
-    public $localTime = null;
+    #[ORM\Column(type: 'LocalTime', nullable: true)]
+    public ?LocalTime $localTime = null;
 
-    /**
-     * @ORM\Column(type="LocalDateTime", nullable=true)
-     *
-     * @var LocalDateTime|null
-     */
-    public $localDateTime = null;
+    #[ORM\Column(type: 'LocalDateTime', nullable: true)]
+    public ?LocalDateTime $localDateTime = null;
 
-    /**
-     * @ORM\Column(type="Duration", nullable=true)
-     *
-     * @var Duration|null
-     */
-    public $duration = null;
+    #[ORM\Column(type: 'Duration', nullable: true)]
+    public ?Duration $duration = null;
 
-    /**
-     * @ORM\Column(type="Period", nullable=true)
-     *
-     * @var Period|null
-     */
-    public $period = null;
+    #[ORM\Column(type: 'Period', nullable: true)]
+    public ?Period $period = null;
 }
diff --git a/tests/Types/DayOfWeekTypeTest.php b/tests/Types/DayOfWeekTypeTest.php
index 53f0aa3..6c21106 100644
--- a/tests/Types/DayOfWeekTypeTest.php
+++ b/tests/Types/DayOfWeekTypeTest.php
@@ -8,12 +8,12 @@
 use Brick\DateTime\Doctrine\Types\DayOfWeekType;
 use Brick\DateTime\LocalDate;
 use Brick\DateTime\LocalTime;
-use Doctrine\DBAL\Platforms\SqlitePlatform;
+use Doctrine\DBAL\Platforms\SQLitePlatform;
 use Doctrine\DBAL\Types\ConversionException;
 use Doctrine\DBAL\Types\Type;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 use stdClass;
-use ValueError;
 
 class DayOfWeekTypeTest extends TestCase
 {
@@ -22,13 +22,11 @@ private function getDayOfWeekType(): DayOfWeekType
         return Type::getType('DayOfWeek');
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValue
-     */
+    #[DataProvider('providerConvertToDatabaseValue')]
     public function testConvertToDatabaseValue(?DayOfWeek $value, ?int $expectedValue): void
     {
         $type = $this->getDayOfWeekType();
-        $actualValue = $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToDatabaseValue($value, new SQLitePlatform());
 
         self::assertSame($expectedValue, $actualValue);
     }
@@ -47,15 +45,13 @@ public static function providerConvertToDatabaseValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValueWithInvalidValue
-     */
-    public function testConvertToDatabaseValueWithInvalidValue($value): void
+    #[DataProvider('providerConvertToDatabaseValueWithInvalidValue')]
+    public function testConvertToDatabaseValueWithInvalidValue(mixed $value): void
     {
         $type = $this->getDayOfWeekType();
 
         $this->expectException(ConversionException::class);
-        $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $type->convertToDatabaseValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToDatabaseValueWithInvalidValue(): array
@@ -71,13 +67,11 @@ public static function providerConvertToDatabaseValueWithInvalidValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValue
-     */
-    public function testConvertToPHPValue($value, ?int $expectedDayOfWeekValue): void
+    #[DataProvider('providerConvertToPHPValue')]
+    public function testConvertToPHPValue(mixed $value, ?int $expectedDayOfWeekValue): void
     {
         $type = $this->getDayOfWeekType();
-        $actualValue = $type->convertToPHPValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToPHPValue($value, new SQLitePlatform());
 
         if ($expectedDayOfWeekValue === null) {
             self::assertNull($actualValue);
@@ -101,24 +95,21 @@ public static function providerConvertToPHPValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValueWithInvalidValue
-     */
-    public function testConvertToPHPValueWithInvalidValue($value, string $expectedExceptionClass): void
+    #[DataProvider('providerConvertToPHPValueWithInvalidValue')]
+    public function testConvertToPHPValueWithInvalidValue(mixed $value, string $expectedExceptionMessage): void
     {
         $type = $this->getDayOfWeekType();
 
-        $this->expectException($expectedExceptionClass);
-        $type->convertToPHPValue($value, new SqlitePlatform());
+        $this->expectException(ConversionException::class);
+        $this->expectExceptionMessage($expectedExceptionMessage);
+        $type->convertToPHPValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToPHPValueWithInvalidValue(): array
     {
         return [
-            [0, ValueError::class],
-            [8, ValueError::class],
-            ['1', ConversionException::class],
-            ['2', ConversionException::class],
+            [0, '0 is not a valid backing value for enum'],
+            [8, '8 is not a valid backing value for enum'],
         ];
     }
 }
diff --git a/tests/Types/DurationTypeTest.php b/tests/Types/DurationTypeTest.php
index ccefb40..aaa68c8 100644
--- a/tests/Types/DurationTypeTest.php
+++ b/tests/Types/DurationTypeTest.php
@@ -4,14 +4,14 @@
 
 namespace Brick\DateTime\Doctrine\Tests\Types;
 
-use Brick\DateTime\DateTimeException;
 use Brick\DateTime\Doctrine\Types\DurationType;
 use Brick\DateTime\LocalDate;
 use Brick\DateTime\Duration;
 use Brick\DateTime\LocalTime;
-use Doctrine\DBAL\Platforms\SqlitePlatform;
+use Doctrine\DBAL\Platforms\SQLitePlatform;
 use Doctrine\DBAL\Types\ConversionException;
 use Doctrine\DBAL\Types\Type;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 use stdClass;
 
@@ -22,13 +22,11 @@ private function getDurationType(): DurationType
         return Type::getType('Duration');
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValue
-     */
+    #[DataProvider('providerConvertToDatabaseValue')]
     public function testConvertToDatabaseValue(?Duration $value, ?string $expectedValue): void
     {
         $type = $this->getDurationType();
-        $actualValue = $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToDatabaseValue($value, new SQLitePlatform());
 
         self::assertSame($expectedValue, $actualValue);
     }
@@ -41,15 +39,13 @@ public static function providerConvertToDatabaseValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValueWithInvalidValue
-     */
-    public function testConvertToDatabaseValueWithInvalidValue($value): void
+    #[DataProvider('providerConvertToDatabaseValueWithInvalidValue')]
+    public function testConvertToDatabaseValueWithInvalidValue(mixed $value): void
     {
         $type = $this->getDurationType();
 
         $this->expectException(ConversionException::class);
-        $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $type->convertToDatabaseValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToDatabaseValueWithInvalidValue(): array
@@ -65,13 +61,11 @@ public static function providerConvertToDatabaseValueWithInvalidValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValue
-     */
-    public function testConvertToPHPValue($value, ?string $expectedDurationString): void
+    #[DataProvider('providerConvertToPHPValue')]
+    public function testConvertToPHPValue(mixed $value, ?string $expectedDurationString): void
     {
         $type = $this->getDurationType();
-        $actualValue = $type->convertToPHPValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToPHPValue($value, new SQLitePlatform());
 
         if ($expectedDurationString === null) {
             self::assertNull($actualValue);
@@ -89,23 +83,22 @@ public static function providerConvertToPHPValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValueWithInvalidValue
-     */
-    public function testConvertToPHPValueWithInvalidValue($value, string $expectedExceptionClass): void
+    #[DataProvider('providerConvertToPHPValueWithInvalidValue')]
+    public function testConvertToPHPValueWithInvalidValue(mixed $value, string $expectedExceptionMessage): void
     {
         $type = $this->getDurationType();
 
-        $this->expectException($expectedExceptionClass);
-        $type->convertToPHPValue($value, new SqlitePlatform());
+        $this->expectException(ConversionException::class);
+        $this->expectExceptionMessage($expectedExceptionMessage);
+        $type->convertToPHPValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToPHPValueWithInvalidValue(): array
     {
         return [
-            [0, DateTimeException::class],
-            ['10:31:00', DateTimeException::class],
-            ['2021-04-00', DateTimeException::class],
+            [0, 'Text cannot be parsed to a Duration: 0'],
+            ['10:31:00', 'Text cannot be parsed to a Duration: 10:31:00'],
+            ['2021-04-00', 'Text cannot be parsed to a Duration: 2021-04-00'],
         ];
     }
 }
diff --git a/tests/Types/InstantTypeTest.php b/tests/Types/InstantTypeTest.php
index a73e305..9770896 100644
--- a/tests/Types/InstantTypeTest.php
+++ b/tests/Types/InstantTypeTest.php
@@ -8,9 +8,10 @@
 use Brick\DateTime\Doctrine\Types\InstantType;
 use Brick\DateTime\LocalDate;
 use Brick\DateTime\LocalTime;
-use Doctrine\DBAL\Platforms\SqlitePlatform;
+use Doctrine\DBAL\Platforms\SQLitePlatform;
 use Doctrine\DBAL\Types\ConversionException;
 use Doctrine\DBAL\Types\Type;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 use stdClass;
 
@@ -21,13 +22,11 @@ private function getInstantType(): InstantType
         return Type::getType('Instant');
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValue
-     */
+    #[DataProvider('providerConvertToDatabaseValue')]
     public function testConvertToDatabaseValue(?Instant $value, ?int $expectedValue): void
     {
         $type = $this->getInstantType();
-        $actualValue = $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToDatabaseValue($value, new SQLitePlatform());
 
         self::assertSame($expectedValue, $actualValue);
     }
@@ -41,15 +40,13 @@ public static function providerConvertToDatabaseValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValueWithInvalidValue
-     */
-    public function testConvertToDatabaseValueWithInvalidValue($value): void
+    #[DataProvider('providerConvertToDatabaseValueWithInvalidValue')]
+    public function testConvertToDatabaseValueWithInvalidValue(mixed $value): void
     {
         $type = $this->getInstantType();
 
         $this->expectException(ConversionException::class);
-        $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $type->convertToDatabaseValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToDatabaseValueWithInvalidValue(): array
@@ -65,13 +62,11 @@ public static function providerConvertToDatabaseValueWithInvalidValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValue
-     */
-    public function testConvertToPHPValue($value, ?int $expectedEpochSecond): void
+    #[DataProvider('providerConvertToPHPValue')]
+    public function testConvertToPHPValue(mixed $value, ?int $expectedEpochSecond): void
     {
         $type = $this->getInstantType();
-        $actualValue = $type->convertToPHPValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToPHPValue($value, new SQLitePlatform());
 
         if ($expectedEpochSecond === null) {
             self::assertNull($actualValue);
diff --git a/tests/Types/LocalDateTimeTypeTest.php b/tests/Types/LocalDateTimeTypeTest.php
index de7322f..9121780 100644
--- a/tests/Types/LocalDateTimeTypeTest.php
+++ b/tests/Types/LocalDateTimeTypeTest.php
@@ -4,14 +4,14 @@
 
 namespace Brick\DateTime\Doctrine\Tests\Types;
 
-use Brick\DateTime\DateTimeException;
 use Brick\DateTime\Doctrine\Types\LocalDateTimeType;
 use Brick\DateTime\LocalDate;
 use Brick\DateTime\LocalDateTime;
 use Brick\DateTime\LocalTime;
-use Doctrine\DBAL\Platforms\SqlitePlatform;
+use Doctrine\DBAL\Platforms\SQLitePlatform;
 use Doctrine\DBAL\Types\ConversionException;
 use Doctrine\DBAL\Types\Type;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 use stdClass;
 
@@ -22,13 +22,11 @@ private function getLocalDateTimeType(): LocalDateTimeType
         return Type::getType('LocalDateTime');
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValue
-     */
+    #[DataProvider('providerConvertToDatabaseValue')]
     public function testConvertToDatabaseValue(?LocalDateTime $value, ?string $expectedValue): void
     {
         $type = $this->getLocalDateTimeType();
-        $actualValue = $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToDatabaseValue($value, new SQLitePlatform());
 
         self::assertSame($expectedValue, $actualValue);
     }
@@ -39,19 +37,18 @@ public static function providerConvertToDatabaseValue(): array
             [null, null],
             [LocalDateTime::of(2021, 4, 17, 9, 2), '2021-04-17 09:02:00'],
             [LocalDateTime::of(2021, 4, 17, 9, 2, 7), '2021-04-17 09:02:07'],
-            [LocalDateTime::of(2021, 4, 17, 9, 2, 0, 7000000), '2021-04-17 09:02:00.007'],
+            [LocalDateTime::of(2021, 4, 17, 9, 2, 0, 7_000_000), '2021-04-17 09:02:00.007'],
+            [LocalDateTime::of(2021, 4, 17, 9, 2, 1, 7_000_000), '2021-04-17 09:02:01.007'],
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValueWithInvalidValue
-     */
-    public function testConvertToDatabaseValueWithInvalidValue($value): void
+    #[DataProvider('providerConvertToDatabaseValueWithInvalidValue')]
+    public function testConvertToDatabaseValueWithInvalidValue(mixed $value): void
     {
         $type = $this->getLocalDateTimeType();
 
         $this->expectException(ConversionException::class);
-        $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $type->convertToDatabaseValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToDatabaseValueWithInvalidValue(): array
@@ -68,13 +65,11 @@ public static function providerConvertToDatabaseValueWithInvalidValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValue
-     */
-    public function testConvertToPHPValue($value, ?string $expectedLocalDateTimeString): void
+    #[DataProvider('providerConvertToPHPValue')]
+    public function testConvertToPHPValue(mixed $value, ?string $expectedLocalDateTimeString): void
     {
         $type = $this->getLocalDateTimeType();
-        $actualValue = $type->convertToPHPValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToPHPValue($value, new SQLitePlatform());
 
         if ($expectedLocalDateTimeString === null) {
             self::assertNull($actualValue);
@@ -95,24 +90,23 @@ public static function providerConvertToPHPValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValueWithInvalidValue
-     */
-    public function testConvertToPHPValueWithInvalidValue($value, string $expectedExceptionClass): void
+    #[DataProvider('providerConvertToPHPValueWithInvalidValue')]
+    public function testConvertToPHPValueWithInvalidValue(mixed $value, string $expectedExceptionMessage): void
     {
         $type = $this->getLocalDateTimeType();
 
-        $this->expectException($expectedExceptionClass);
-        $type->convertToPHPValue($value, new SqlitePlatform());
+        $this->expectException(ConversionException::class);
+        $this->expectExceptionMessage($expectedExceptionMessage);
+        $type->convertToPHPValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToPHPValueWithInvalidValue(): array
     {
         return [
-            [0, DateTimeException::class],
-            ['01:02:59', DateTimeException::class],
-            ['2021-04-17', DateTimeException::class],
-            ['2021-04-17Z01:02:03.456', DateTimeException::class],
+            [0, 'Failed to parse "0"'],
+            ['01:02:59', 'Failed to parse "01:02:59".'],
+            ['2021-04-17', 'Failed to parse "2021-04-17".'],
+            ['2021-04-17Z01:02:03.456', 'Failed to parse "2021-04-17Z01:02:03.456".'],
         ];
     }
 }
diff --git a/tests/Types/LocalDateTypeTest.php b/tests/Types/LocalDateTypeTest.php
index 50d9d35..85f9f09 100644
--- a/tests/Types/LocalDateTypeTest.php
+++ b/tests/Types/LocalDateTypeTest.php
@@ -4,14 +4,14 @@
 
 namespace Brick\DateTime\Doctrine\Tests\Types;
 
-use Brick\DateTime\DateTimeException;
 use Brick\DateTime\Doctrine\Types\LocalDateType;
 use Brick\DateTime\LocalDate;
 use Brick\DateTime\LocalDateTime;
 use Brick\DateTime\LocalTime;
-use Doctrine\DBAL\Platforms\SqlitePlatform;
+use Doctrine\DBAL\Platforms\SQLitePlatform;
 use Doctrine\DBAL\Types\ConversionException;
 use Doctrine\DBAL\Types\Type;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 use stdClass;
 
@@ -22,13 +22,11 @@ private function getLocalDateType(): LocalDateType
         return Type::getType('LocalDate');
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValue
-     */
+    #[DataProvider('providerConvertToDatabaseValue')]
     public function testConvertToDatabaseValue(?LocalDate $value, ?string $expectedValue): void
     {
         $type = $this->getLocalDateType();
-        $actualValue = $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToDatabaseValue($value, new SQLitePlatform());
 
         self::assertSame($expectedValue, $actualValue);
     }
@@ -41,15 +39,13 @@ public static function providerConvertToDatabaseValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValueWithInvalidValue
-     */
-    public function testConvertToDatabaseValueWithInvalidValue($value): void
+    #[DataProvider('providerConvertToDatabaseValueWithInvalidValue')]
+    public function testConvertToDatabaseValueWithInvalidValue(mixed $value): void
     {
         $type = $this->getLocalDateType();
 
         $this->expectException(ConversionException::class);
-        $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $type->convertToDatabaseValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToDatabaseValueWithInvalidValue(): array
@@ -65,13 +61,11 @@ public static function providerConvertToDatabaseValueWithInvalidValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValue
-     */
-    public function testConvertToPHPValue($value, ?string $expectedLocalDateString): void
+    #[DataProvider('providerConvertToPHPValue')]
+    public function testConvertToPHPValue(mixed $value, ?string $expectedLocalDateString): void
     {
         $type = $this->getLocalDateType();
-        $actualValue = $type->convertToPHPValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToPHPValue($value, new SQLitePlatform());
 
         if ($expectedLocalDateString === null) {
             self::assertNull($actualValue);
@@ -89,23 +83,22 @@ public static function providerConvertToPHPValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValueWithInvalidValue
-     */
-    public function testConvertToPHPValueWithInvalidValue($value, string $expectedExceptionClass): void
+    #[DataProvider('providerConvertToPHPValueWithInvalidValue')]
+    public function testConvertToPHPValueWithInvalidValue(mixed $value, string $expectedExceptionMessage): void
     {
         $type = $this->getLocalDateType();
 
-        $this->expectException($expectedExceptionClass);
-        $type->convertToPHPValue($value, new SqlitePlatform());
+        $this->expectException(ConversionException::class);
+        $this->expectExceptionMessage($expectedExceptionMessage);
+        $type->convertToPHPValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToPHPValueWithInvalidValue(): array
     {
         return [
-            [0, DateTimeException::class],
-            ['10:31:00', DateTimeException::class],
-            ['2021-04-00', DateTimeException::class],
+            [0, 'Failed to parse "0".'],
+            ['10:31:00', 'Failed to parse "10:31:00".'],
+            ['2021-04-00', 'Invalid day-of-month: 0 is not in the range 1 to 31.'],
         ];
     }
 }
diff --git a/tests/Types/LocalTimeTypeTest.php b/tests/Types/LocalTimeTypeTest.php
index 08b09ce..ec4454c 100644
--- a/tests/Types/LocalTimeTypeTest.php
+++ b/tests/Types/LocalTimeTypeTest.php
@@ -4,14 +4,14 @@
 
 namespace Brick\DateTime\Doctrine\Tests\Types;
 
-use Brick\DateTime\DateTimeException;
 use Brick\DateTime\Doctrine\Types\LocalTimeType;
 use Brick\DateTime\LocalDate;
 use Brick\DateTime\LocalTime;
 use Brick\DateTime\LocalDateTime;
-use Doctrine\DBAL\Platforms\SqlitePlatform;
+use Doctrine\DBAL\Platforms\SQLitePlatform;
 use Doctrine\DBAL\Types\ConversionException;
 use Doctrine\DBAL\Types\Type;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 use stdClass;
 
@@ -22,13 +22,11 @@ private function getLocalTimeType(): LocalTimeType
         return Type::getType('LocalTime');
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValue
-     */
+    #[DataProvider('providerConvertToDatabaseValue')]
     public function testConvertToDatabaseValue(?LocalTime $value, ?string $expectedValue): void
     {
         $type = $this->getLocalTimeType();
-        $actualValue = $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToDatabaseValue($value, new SQLitePlatform());
 
         self::assertSame($expectedValue, $actualValue);
     }
@@ -39,19 +37,18 @@ public static function providerConvertToDatabaseValue(): array
             [null, null],
             [LocalTime::of(9, 2), '09:02:00'],
             [LocalTime::of(10, 31, 1), '10:31:01'],
-            [LocalTime::of(10, 31, 1, 7000000), '10:31:01.007'],
+            [LocalTime::of(10, 31, 0, 7_000_000), '10:31:00.007'],
+            [LocalTime::of(10, 31, 1, 7_000_000), '10:31:01.007'],
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValueWithInvalidValue
-     */
-    public function testConvertToDatabaseValueWithInvalidValue($value): void
+    #[DataProvider('providerConvertToDatabaseValueWithInvalidValue')]
+    public function testConvertToDatabaseValueWithInvalidValue(mixed $value): void
     {
         $type = $this->getLocalTimeType();
 
         $this->expectException(ConversionException::class);
-        $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $type->convertToDatabaseValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToDatabaseValueWithInvalidValue(): array
@@ -67,13 +64,11 @@ public static function providerConvertToDatabaseValueWithInvalidValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValue
-     */
-    public function testConvertToPHPValue($value, ?string $expectedLocalTimeString): void
+    #[DataProvider('providerConvertToPHPValue')]
+    public function testConvertToPHPValue(mixed $value, ?string $expectedLocalTimeString): void
     {
         $type = $this->getLocalTimeType();
-        $actualValue = $type->convertToPHPValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToPHPValue($value, new SQLitePlatform());
 
         if ($expectedLocalTimeString === null) {
             self::assertNull($actualValue);
@@ -92,23 +87,22 @@ public static function providerConvertToPHPValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValueWithInvalidValue
-     */
-    public function testConvertToPHPValueWithInvalidValue($value, string $expectedExceptionClass): void
+    #[DataProvider('providerConvertToPHPValueWithInvalidValue')]
+    public function testConvertToPHPValueWithInvalidValue(mixed $value, string $expectedExceptionMessage): void
     {
         $type = $this->getLocalTimeType();
 
-        $this->expectException($expectedExceptionClass);
-        $type->convertToPHPValue($value, new SqlitePlatform());
+        $this->expectException(ConversionException::class);
+        $this->expectExceptionMessage($expectedExceptionMessage);
+        $type->convertToPHPValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToPHPValueWithInvalidValue(): array
     {
         return [
-            [0, DateTimeException::class],
-            ['01:02:60', DateTimeException::class],
-            ['2021-04-17', DateTimeException::class],
+            [0, 'Failed to parse "0".'],
+            ['01:02:60', 'Invalid second-of-minute: 60 is not in the range 0 to 59.'],
+            ['2021-04-17', 'Failed to parse "2021-04-17".'],
         ];
     }
 }
diff --git a/tests/Types/PeriodTypeTest.php b/tests/Types/PeriodTypeTest.php
index 68a1bb8..ec5f643 100644
--- a/tests/Types/PeriodTypeTest.php
+++ b/tests/Types/PeriodTypeTest.php
@@ -4,14 +4,14 @@
 
 namespace Brick\DateTime\Doctrine\Tests\Types;
 
-use Brick\DateTime\DateTimeException;
 use Brick\DateTime\Doctrine\Types\PeriodType;
 use Brick\DateTime\LocalDate;
 use Brick\DateTime\Period;
 use Brick\DateTime\LocalTime;
-use Doctrine\DBAL\Platforms\SqlitePlatform;
+use Doctrine\DBAL\Platforms\SQLitePlatform;
 use Doctrine\DBAL\Types\ConversionException;
 use Doctrine\DBAL\Types\Type;
+use PHPUnit\Framework\Attributes\DataProvider;
 use PHPUnit\Framework\TestCase;
 use stdClass;
 
@@ -22,13 +22,11 @@ private function getPeriodType(): PeriodType
         return Type::getType('Period');
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValue
-     */
+    #[DataProvider('providerConvertToDatabaseValue')]
     public function testConvertToDatabaseValue(?Period $value, ?string $expectedValue): void
     {
         $type = $this->getPeriodType();
-        $actualValue = $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToDatabaseValue($value, new SQLitePlatform());
 
         self::assertSame($expectedValue, $actualValue);
     }
@@ -41,15 +39,13 @@ public static function providerConvertToDatabaseValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToDatabaseValueWithInvalidValue
-     */
-    public function testConvertToDatabaseValueWithInvalidValue($value): void
+    #[DataProvider('providerConvertToDatabaseValueWithInvalidValue')]
+    public function testConvertToDatabaseValueWithInvalidValue(mixed $value): void
     {
         $type = $this->getPeriodType();
 
         $this->expectException(ConversionException::class);
-        $type->convertToDatabaseValue($value, new SqlitePlatform());
+        $type->convertToDatabaseValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToDatabaseValueWithInvalidValue(): array
@@ -65,13 +61,11 @@ public static function providerConvertToDatabaseValueWithInvalidValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValue
-     */
-    public function testConvertToPHPValue($value, ?string $expectedPeriodString): void
+    #[DataProvider('providerConvertToPHPValue')]
+    public function testConvertToPHPValue(mixed $value, ?string $expectedPeriodString): void
     {
         $type = $this->getPeriodType();
-        $actualValue = $type->convertToPHPValue($value, new SqlitePlatform());
+        $actualValue = $type->convertToPHPValue($value, new SQLitePlatform());
 
         if ($expectedPeriodString === null) {
             self::assertNull($actualValue);
@@ -89,23 +83,22 @@ public static function providerConvertToPHPValue(): array
         ];
     }
 
-    /**
-     * @dataProvider providerConvertToPHPValueWithInvalidValue
-     */
-    public function testConvertToPHPValueWithInvalidValue($value, string $expectedExceptionClass): void
+    #[DataProvider('providerConvertToPHPValueWithInvalidValue')]
+    public function testConvertToPHPValueWithInvalidValue(mixed $value, string $expectedExceptionMessage): void
     {
         $type = $this->getPeriodType();
 
-        $this->expectException($expectedExceptionClass);
-        $type->convertToPHPValue($value, new SqlitePlatform());
+        $this->expectException(ConversionException::class);
+        $this->expectExceptionMessage($expectedExceptionMessage);
+        $type->convertToPHPValue($value, new SQLitePlatform());
     }
 
     public static function providerConvertToPHPValueWithInvalidValue(): array
     {
         return [
-            [0, DateTimeException::class],
-            ['10:31:00', DateTimeException::class],
-            ['2021-04-00', DateTimeException::class],
+            [0, 'Text cannot be parsed to a Period: 0'],
+            ['10:31:00', 'Text cannot be parsed to a Period: 10:31:00'],
+            ['2021-04-00', 'Text cannot be parsed to a Period: 2021-04-00'],
         ];
     }
 }
diff --git a/tests/TypesFunctionalTest.php b/tests/TypesFunctionalTest.php
index de27089..422d6fc 100644
--- a/tests/TypesFunctionalTest.php
+++ b/tests/TypesFunctionalTest.php
@@ -14,6 +14,7 @@
 use Brick\DateTime\Period;
 use Doctrine\DBAL\Connection;
 use Doctrine\ORM\Tools\SchemaTool;
+use PHPUnit\Framework\Attributes\Depends;
 
 class TypesFunctionalTest extends AbstractFunctionalTestCase
 {
@@ -29,22 +30,20 @@ public function testCreateSchema(): Connection
         self::assertCount(1, $sql);
         $sql = $sql[0];
 
-        self::assertStringContainsString('dayOfWeek SMALLINT DEFAULT NULL --(DC2Type:DayOfWeek)', $sql);
-        self::assertStringContainsString('instant INTEGER DEFAULT NULL --(DC2Type:Instant)', $sql);
-        self::assertStringContainsString('localDate DATE DEFAULT NULL --(DC2Type:LocalDate)', $sql);
-        self::assertStringContainsString('localTime TIME DEFAULT NULL --(DC2Type:LocalTime)', $sql);
-        self::assertStringContainsString('localDateTime DATETIME DEFAULT NULL --(DC2Type:LocalDateTime)', $sql);
-        self::assertStringContainsString('duration VARCHAR(64) DEFAULT NULL --(DC2Type:Duration)', $sql);
-        self::assertStringContainsString('period VARCHAR(64) DEFAULT NULL --(DC2Type:Period)', $sql);
+        self::assertStringContainsString('dayOfWeek SMALLINT DEFAULT NULL', $sql);
+        self::assertStringContainsString('instant INTEGER DEFAULT NULL', $sql);
+        self::assertStringContainsString('localDate DATE DEFAULT NULL', $sql);
+        self::assertStringContainsString('localTime TIME DEFAULT NULL', $sql);
+        self::assertStringContainsString('localDateTime DATETIME DEFAULT NULL', $sql);
+        self::assertStringContainsString('duration VARCHAR(64) DEFAULT NULL', $sql);
+        self::assertStringContainsString('period VARCHAR(64) DEFAULT NULL', $sql);
 
-        $connection->exec($sql);
+        $connection->executeStatement($sql);
 
         return $connection;
     }
 
-    /**
-     * @depends testCreateSchema
-     */
+    #[Depends('testCreateSchema')]
     public function testSaveNull(Connection $connection): Connection
     {
         $em = self::createEntityManager($connection);
@@ -61,9 +60,7 @@ public function testSaveNull(Connection $connection): Connection
         return $connection;
     }
 
-    /**
-     * @depends testSaveNull
-     */
+    #[Depends('testSaveNull')]
     public function testLoadNull(Connection $connection): void
     {
         $em = self::createEntityManager($connection);
@@ -81,9 +78,7 @@ public function testLoadNull(Connection $connection): void
         self::assertNull($entity->period);
     }
 
-    /**
-     * @depends testCreateSchema
-     */
+    #[Depends('testCreateSchema')]
     public function testSaveValues(Connection $connection): Connection
     {
         $em = self::createEntityManager($connection);
@@ -108,9 +103,7 @@ public function testSaveValues(Connection $connection): Connection
         return $connection;
     }
 
-    /**
-     * @depends testSaveValues
-     */
+    #[Depends('testSaveValues')]
     public function testLoadValues(Connection $connection): void
     {
         $em = self::createEntityManager($connection);