diff --git a/README.md b/README.md index 5cabd85..c550602 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ This Symfony5 bundle provides the integration of [Symfony validation component]( - [PhoneMobile](/src/Doctrine/DBAL/Types/PhoneMobileType.php) - [Phone](/src/Doctrine/DBAL/Types/PhoneType.php) - [Postal](/src/Doctrine/DBAL/Types/PostalType.php) +- [SpanishNifType](/src/Doctrine/DBAL/Types/SpanishNifType.php) - [Timezone](/src/Doctrine/DBAL/Types/TimezoneType.php) It also supports nullable and non-nullable fields. diff --git a/src/Doctrine/DBAL/Types/SpanishNifType.php b/src/Doctrine/DBAL/Types/SpanishNifType.php new file mode 100644 index 0000000..9c13941 --- /dev/null +++ b/src/Doctrine/DBAL/Types/SpanishNifType.php @@ -0,0 +1,21 @@ +type->getName()); + } + + public function testGetSQLDeclaration(): void + { + $this->abstractPlatform + ->method('getVarcharTypeDeclarationSQL') + ->with(['length' => SpanishNifType::LENGTH]) + ->willReturn('VARCHAR'); + + self::assertSame('VARCHAR', $this->type->getSQLDeclaration([], $this->abstractPlatform)); + } +}