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

testVisit() public method

Test the ObjectStateList visitor.
public testVisit ( ) : string
return string
    public function testVisit()
    {
        $visitor = $this->getVisitor();
        $generator = $this->getGenerator();
        $generator->startDocument(null);
        // @todo coverage add actual object states + visitor mock for RestObjectState
        $stateList = new ObjectStateList(array(), 42);
        $this->addRouteExpectation('ezpublish_rest_loadObjectStates', array('objectStateGroupId' => $stateList->groupId), "/content/objectstategroups/{$stateList->groupId}/objectstates");
        $visitor->visit($this->getVisitorMock(), $generator, $stateList);
        $result = $generator->endDocument(null);
        $this->assertNotNull($result);
        return $result;
    }