eZ\Publish\Core\Persistence\Legacy\Tests\Content\FieldValue\Converter\DateTest::testToFieldDefinitionDefaultCurrentDate PHP Метод

testToFieldDefinitionDefaultCurrentDate() публичный Метод

    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']);
    }