From b78227ea5d676e36eba4cf809886589a4a7f7041 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Mon, 6 Aug 2012 20:17:18 -0500 Subject: [PATCH] Full code-coverage for UuidType::convertToDatabaseValue --- tests/Rhumsaa/Uuid/Doctrine/UuidTypeTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 */