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

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

    public function testToStorageFieldDefinitionSingle()
    {
        $fieldDefinition = new PersistenceFieldDefinition(array('fieldTypeConstraints' => new FieldTypeConstraints(array('fieldSettings' => new FieldSettings(array('isMultiple' => false, 'options' => array(0 => 'First')))))));
        $expectedStorageFieldDefinition = new StorageFieldDefinition();
        $expectedStorageFieldDefinition->dataInt1 = 0;
        $expectedStorageFieldDefinition->dataText5 = <<<EOT
<?xml version="1.0" encoding="utf-8"?>
<ezselection><options><option id="0" name="First"/></options></ezselection>

EOT;
        $actualStorageFieldDefinition = new StorageFieldDefinition();
        $this->converter->toStorageFieldDefinition($fieldDefinition, $actualStorageFieldDefinition);
        $this->assertEquals($expectedStorageFieldDefinition, $actualStorageFieldDefinition);
    }