Inheritance: implements eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter
Ejemplo n.º 1
0
 /**
  * @covers \eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\DateConverter::toFieldDefinition
  */
 public function testToFieldDefinitionDefaultCurrentDate()
 {
     $dateTime = new DateTime();
     $timestamp = $dateTime->setTime(0, 0, 0)->getTimestamp();
     $fieldDef = new PersistenceFieldDefinition();
     $storageDef = new StorageFieldDefinition(array('dataInt1' => DateType::DEFAULT_CURRENT_DATE));
     $this->converter->toFieldDefinition($storageDef, $fieldDef);
     self::assertInternalType('array', $fieldDef->defaultValue->data);
     self::assertCount(2, $fieldDef->defaultValue->data);
     self::assertNull($fieldDef->defaultValue->data['rfc850']);
     self::assertSame($timestamp, $fieldDef->defaultValue->data['timestamp']);
 }