eZ\Publish\Core\Persistence\Legacy\Tests\Content\FieldValue\Converter\DateAndTimeTest::testToFieldDefinitionCurrentDate PHP Method

testToFieldDefinitionCurrentDate() public method

    public function testToFieldDefinitionCurrentDate()
    {
        $time = time();
        $fieldDef = new PersistenceFieldDefinition();
        $storageDef = new StorageFieldDefinition(array('dataInt1' => DateAndTimeType::DEFAULT_CURRENT_DATE, 'dataInt2' => 1));
        $this->converter->toFieldDefinition($storageDef, $fieldDef);
        self::assertInternalType('array', $fieldDef->defaultValue->data);
        self::assertCount(2, $fieldDef->defaultValue->data);
        self::assertNull($fieldDef->defaultValue->data['rfc850']);
        self::assertGreaterThanOrEqual($time, $fieldDef->defaultValue->data['timestamp']);
    }