public function testVisitFieldDefinitionList()
{
$visitor = $this->getVisitor();
$generator = $this->getGenerator();
$generator->startDocument(null);
$fieldDefinitionList = $this->getBasicFieldDefinitionList();
$this->getVisitorMock()->expects($this->exactly(2))->method('visitValueObject')->with($this->isInstanceOf('eZ\\Publish\\Core\\REST\\Server\\Values\\RestFieldDefinition'));
$this->addRouteExpectation('ezpublish_rest_loadContentTypeFieldDefinitionList', array('contentTypeId' => $fieldDefinitionList->contentType->id), "/content/types/{$fieldDefinitionList->contentType->id}/fieldDefinitions");
$visitor->visit($this->getVisitorMock(), $generator, $fieldDefinitionList);
$result = $generator->endDocument(null);
$this->assertNotNull($result);
$dom = new \DOMDocument();
$dom->loadXml($result);
return $dom;
}