eZ\Publish\Core\REST\Server\Tests\Output\ValueObjectVisitor\RestContentTest::testVisitWithoutEmbeddedVersion PHP Method

testVisitWithoutEmbeddedVersion() public method

public testVisitWithoutEmbeddedVersion ( ) : DOMDocument
return DOMDocument
    public function testVisitWithoutEmbeddedVersion()
    {
        $visitor = $this->getVisitor();
        $generator = $this->getGenerator();
        $generator->startDocument(null);
        $restContent = $this->getBasicRestContent();
        $this->getVisitorMock()->expects($this->never())->method('visitValueObject');
        $this->addRouteExpectation('ezpublish_rest_loadContent', array('contentId' => $restContent->contentInfo->id), "/content/objects/{$restContent->contentInfo->id}");
        $this->addRouteExpectation('ezpublish_rest_loadContentType', array('contentTypeId' => $restContent->contentInfo->contentTypeId), "/content/types/{$restContent->contentInfo->contentTypeId}");
        $this->addRouteExpectation('ezpublish_rest_loadContentVersions', array('contentId' => $restContent->contentInfo->id), "/content/objects/{$restContent->contentInfo->id}/versions");
        $this->addRouteExpectation('ezpublish_rest_redirectCurrentVersion', array('contentId' => $restContent->contentInfo->id), "/content/objects/{$restContent->contentInfo->id}/currentversion");
        $this->addRouteExpectation('ezpublish_rest_loadSection', array('sectionId' => $restContent->contentInfo->sectionId), "/content/sections/{$restContent->contentInfo->sectionId}");
        $this->addRouteExpectation('ezpublish_rest_loadLocation', array('locationPath' => $locationPath = trim($restContent->mainLocation->pathString, '/')), "/content/locations/{$locationPath}");
        $this->addRouteExpectation('ezpublish_rest_loadLocationsForContent', array('contentId' => $restContent->contentInfo->id), "/content/objects/{$restContent->contentInfo->id}/locations");
        $this->addRouteExpectation('ezpublish_rest_loadUser', array('userId' => $restContent->contentInfo->ownerId), "/user/users/{$restContent->contentInfo->ownerId}");
        $this->addRouteExpectation('ezpublish_rest_getObjectStatesForContent', array('contentId' => $restContent->contentInfo->id), "/content/objects/{$restContent->contentInfo->id}/objectstates");
        $visitor->visit($this->getVisitorMock(), $generator, $restContent);
        $result = $generator->endDocument(null);
        $this->assertNotNull($result);
        $dom = new \DOMDocument();
        $dom->loadXml($result);
        return $dom;
    }