eZ\Publish\Core\REST\Client\Tests\Output\ValueObjectVisitor\LocationCreateStructTest::testVisit PHP Method

testVisit() public method

Tests the LocationCreateStruct visitor.
public testVisit ( ) : string
return string
    public function testVisit()
    {
        $visitor = $this->getVisitor();
        $generator = $this->getGenerator();
        $generator->startDocument(null);
        $locationCreateStruct = new LocationCreateStruct();
        $locationCreateStruct->hidden = false;
        $locationCreateStruct->parentLocationId = 42;
        $locationCreateStruct->priority = 0;
        $locationCreateStruct->remoteId = 'remote-id';
        $locationCreateStruct->sortField = Location::SORT_FIELD_PATH;
        $locationCreateStruct->sortOrder = Location::SORT_ORDER_ASC;
        $this->locationServiceMock->expects($this->once())->method('loadLocation')->with(42)->will($this->returnValue(new Location(['pathString' => '/1/2/42'])));
        $this->getRouterMock()->expects($this->once())->method('generate')->with('ezpublish_rest_loadLocation', ['locationPath' => '1/2/42'])->will($this->returnValue('/content/locations/1/2/42'));
        $visitor->visit($this->getVisitorMock(), $generator, $locationCreateStruct);
        $result = $generator->endDocument(null);
        $this->assertNotNull($result);
        return $result;
    }