eZ\Publish\Core\REST\Server\Tests\Output\ValueObjectVisitor\RestFieldDefinitionTest::testVisitRestFieldDefinition PHP Method

testVisitRestFieldDefinition() public method

public testVisitRestFieldDefinition ( ) : DOMDocument
return DOMDocument
    public function testVisitRestFieldDefinition()
    {
        $visitor = $this->getVisitor();
        $generator = $this->getGenerator();
        $generator->startDocument(null);
        $restFieldDefinition = $this->getBasicRestFieldDefinition();
        $this->fieldTypeSerializerMock->expects($this->once())->method('serializeFieldDefaultValue')->with($this->isInstanceOf('eZ\\Publish\\Core\\REST\\Common\\Output\\Generator'), $this->equalTo('my-field-type'), $this->equalTo('my default value text'));
        $this->addRouteExpectation('ezpublish_rest_loadContentTypeFieldDefinition', array('contentTypeId' => $restFieldDefinition->contentType->id, 'fieldDefinitionId' => $restFieldDefinition->fieldDefinition->id), "/content/types/{$restFieldDefinition->contentType->id}/fieldDefinitions/{$restFieldDefinition->fieldDefinition->id}");
        $visitor->visit($this->getVisitorMock(), $generator, $restFieldDefinition);
        $result = $generator->endDocument(null);
        $this->assertNotNull($result);
        $dom = new \DOMDocument();
        $dom->loadXml($result);
        return $dom;
    }