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

EOT;
        $actualStorageFieldValue = new StorageFieldValue();
        $this->converter->expects($this->once())->method("getRelationXmlHashFromDB")->with($destinationContentIds)->will($this->returnValue(array()));
        $this->converter->toStorageValue($fieldValue, $actualStorageFieldValue);
        $this->assertEquals($expectedStorageFieldValue, $actualStorageFieldValue);
    }