public function testSerializeFieldSettings()
{
$serializer = $this->getFieldTypeSerializer();
$this->getGeneratorMock()->expects($this->once())->method('generateFieldTypeHash')->with($this->equalTo('fieldSettings'), $this->equalTo(array('foo' => 'bar')));
$fieldTypeMock = $this->getFieldTypeMock();
$this->getFieldTypeServiceMock()->expects($this->once())->method('getFieldType')->with($this->equalTo('myFancyFieldType'))->will($this->returnCallback(function () use($fieldTypeMock) {
return $fieldTypeMock;
}));
$fieldTypeMock->expects($this->once())->method('fieldSettingsToHash')->with($this->equalTo('my-field-settings'))->will($this->returnValue(array('foo' => 'bar')));
$serializer->serializeFieldSettings($this->getGeneratorMock(), 'myFancyFieldType', 'my-field-settings');
}