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

testVisit() public method

Test the Location visitor.
public testVisit ( ) : string
return string
    public function testVisit()
    {
        $visitor = $this->getVisitor();
        $generator = $this->getGenerator();
        $generator->startDocument(null);
        $location = new RestLocation(new Location(array('id' => 1, 'priority' => 0, 'hidden' => false, 'invisible' => true, 'remoteId' => 'remote-id', 'parentLocationId' => null, 'pathString' => '/1', 'depth' => 3, 'sortField' => Location::SORT_FIELD_PATH, 'sortOrder' => Location::SORT_ORDER_ASC, 'contentInfo' => new ContentInfo(array('id' => 42, 'contentTypeId' => 4, 'name' => 'A Node, long lost')))), 0);
        $this->addRouteExpectation('ezpublish_rest_loadLocation', array('locationPath' => '1'), '/content/locations/1');
        $this->addRouteExpectation('ezpublish_rest_loadLocationChildren', array('locationPath' => '1'), '/content/locations/1/children');
        $this->addRouteExpectation('ezpublish_rest_loadContent', array('contentId' => $location->location->contentId), "/content/objects/{$location->location->contentId}");
        $this->addRouteExpectation('ezpublish_rest_listLocationURLAliases', array('locationPath' => '1'), '/content/objects/1/urlaliases');
        $this->addRouteExpectation('ezpublish_rest_loadContent', array('contentId' => $location->location->contentId), "/content/objects/{$location->location->contentId}");
        $this->getVisitorMock()->expects($this->once())->method('visitValueObject')->with($this->isInstanceOf('eZ\\Publish\\Core\\REST\\Server\\Values\\RestContent'));
        $visitor->visit($this->getVisitorMock(), $generator, $location);
        $result = $generator->endDocument(null);
        $this->assertNotNull($result);
        return $result;
    }