/** * @group fieldType * @group selection * @covers \eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\Selection::toFieldValue */ public function testToFieldValueEmpty() { $storageFieldValue = new StorageFieldValue(); $storageFieldValue->dataText = ''; $storageFieldValue->sortKeyString = ''; $expectedFieldValue = new FieldValue(); $expectedFieldValue->data = array(); $expectedFieldValue->sortKey = ''; $actualFieldValue = new FieldValue(); $this->converter->toFieldValue($storageFieldValue, $actualFieldValue); $this->assertEquals($expectedFieldValue, $actualFieldValue); }
/** * @group fieldType * @group relationlist */ public function testToFieldValueEmpty() { $storageFieldValue = new StorageFieldValue(); $storageFieldValue->sortKeyString = ''; $storageFieldValue->dataText = <<<EOT <?xml version="1.0" encoding="utf-8"?> <related-objects><relation-list/></related-objects> EOT; $expectedFieldValue = new FieldValue(); $expectedFieldValue->data = array("destinationContentIds" => array()); $actualFieldValue = new FieldValue(); $this->converter->toFieldValue($storageFieldValue, $actualFieldValue); $this->assertEquals($expectedFieldValue, $actualFieldValue); }