_platform = new \Doctrine\Tests\DBAL\Mocks\MockPlatform(); $this->_type = Type::getType('time'); } public function testTimeConvertsToDatabaseValue() { $this->assertTrue( is_string($this->_type->convertToDatabaseValue(new \DateTime(), $this->_platform)) ); } public function testTimeConvertsToPHPValue() { $this->assertTrue( $this->_type->convertToPHPValue('5:30:55', $this->_platform) instanceof \DateTime ); } public function testInvalidTimeFormatConversion() { $this->setExpectedException('Doctrine\DBAL\Types\ConversionException'); $this->_type->convertToPHPValue('abcdefg', $this->_platform); } public function testNullConversion() { $this->assertNull($this->_type->convertToPHPValue(null, $this->_platform)); } public function testConvertDateTimeToPHPValue() { $date = new \DateTime("now"); $this->assertSame($date, $this->_type->convertToPHPValue($date, $this->_platform)); } }