eZ\Publish\Core\REST\Server\Tests\Output\ValueObjectVisitor\VersionInfoTest::testVisit PHP Method

testVisit() public method

Test the VersionInfo visitor.
public testVisit ( ) : string
return string
    public function testVisit()
    {
        $visitor = $this->getVisitor();
        $generator = $this->getGenerator();
        $generator->startDocument(null);
        $versionInfo = new Content\VersionInfo(array('id' => 23, 'versionNo' => 5, 'status' => Content\VersionInfo::STATUS_PUBLISHED, 'creationDate' => $this->creationDate, 'creatorId' => 14, 'modificationDate' => $this->modificationDate, 'initialLanguageCode' => 'eng-US', 'languageCodes' => array('eng-US', 'ger-DE'), 'names' => array('eng-US' => 'Sindelfingen', 'eng-GB' => 'Bielefeld'), 'contentInfo' => new ContentInfo(array('id' => 42))));
        $this->addRouteExpectation('ezpublish_rest_loadUser', array('userId' => $versionInfo->creatorId), "/user/users/{$versionInfo->creatorId}");
        $this->addRouteExpectation('ezpublish_rest_loadContent', array('contentId' => $versionInfo->contentInfo->id), "/content/objects/{$versionInfo->contentInfo->id}");
        $visitor->visit($this->getVisitorMock(), $generator, $versionInfo);
        $result = $generator->endDocument(null);
        $this->assertNotNull($result);
        return $result;
    }