diff --git a/tests/Rhumsaa/Uuid/Doctrine/UuidTypeTest.php b/tests/Rhumsaa/Uuid/Doctrine/UuidTypeTest.php index 2875143..c086596 100644 --- a/tests/Rhumsaa/Uuid/Doctrine/UuidTypeTest.php +++ b/tests/Rhumsaa/Uuid/Doctrine/UuidTypeTest.php @@ -41,6 +41,23 @@ class UuidTypeTest extends PHPUnit_Framework_TestCase $this->assertEquals($expected, $actual); } + /** + * @covers Rhumsaa\Uuid\Doctrine\UuidType::convertToDatabaseValue + */ + public function testInvalidUuidConversionForDatabaseValue() + { + $this->setExpectedException('Doctrine\DBAL\Types\ConversionException'); + $this->type->convertToDatabaseValue('abcdefg', $this->platform); + } + + /** + * @covers Rhumsaa\Uuid\Doctrine\UuidType::convertToDatabaseValue + */ + public function testNullConversionForDatabaseValue() + { + $this->assertNull($this->type->convertToDatabaseValue(null, $this->platform)); + } + /** * @covers Rhumsaa\Uuid\Doctrine\UuidType::convertToPHPValue */