public function testVisitDefinedType()
{
$visitor = $this->getVisitor();
$generator = $this->getGenerator();
$generator->startDocument(null);
$restContentType = $this->getBasicContentType();
$this->getVisitorMock()->expects($this->once())->method('visitValueObject')->with($this->isInstanceOf('eZ\\Publish\\Core\\REST\\Server\\Values\\FieldDefinitionList'));
$this->addRouteExpectation('ezpublish_rest_loadContentType', array('contentTypeId' => $restContentType->contentType->id), "/content/types/{$restContentType->contentType->id}");
$this->addRouteExpectation('ezpublish_rest_loadUser', array('userId' => $restContentType->contentType->creatorId), "/user/users/{$restContentType->contentType->creatorId}");
$this->addRouteExpectation('ezpublish_rest_loadUser', array('userId' => $restContentType->contentType->modifierId), "/user/users/{$restContentType->contentType->modifierId}");
$this->addRouteExpectation('ezpublish_rest_loadGroupsOfContentType', array('contentTypeId' => $restContentType->contentType->id), "/content/types/{$restContentType->contentType->id}/groups");
$this->addRouteExpectation('ezpublish_rest_loadContentTypeDraft', array('contentTypeId' => $restContentType->contentType->id), "/content/types/{$restContentType->contentType->id}/draft");
$visitor->visit($this->getVisitorMock(), $generator, $restContentType);
$result = $generator->endDocument(null);
$this->assertNotNull($result);
$dom = new \DOMDocument();
$dom->loadXml($result);
return $dom;
}