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

testVisit() public method

Test the RestObjectState visitor.
public testVisit ( ) : string
return string
    public function testVisit()
    {
        $visitor = $this->getVisitor();
        $generator = $this->getGenerator();
        $generator->startDocument(null);
        $objectState = new Values\RestObjectState(new ObjectState(array('id' => 42, 'identifier' => 'test-state', 'priority' => '0', 'defaultLanguageCode' => 'eng-GB', 'languageCodes' => array('eng-GB', 'eng-US'), 'names' => array('eng-GB' => 'State name EN', 'eng-US' => 'State name EN US'), 'descriptions' => array('eng-GB' => 'State description EN', 'eng-US' => 'State description EN US'))), 21);
        $this->addRouteExpectation('ezpublish_rest_loadObjectState', array('objectStateGroupId' => $objectState->groupId, 'objectStateId' => $objectState->objectState->id), "/content/objectstategroups/{$objectState->groupId}/objectstates/{$objectState->objectState->id}");
        $this->addRouteExpectation('ezpublish_rest_loadObjectStateGroup', array('objectStateGroupId' => $objectState->groupId), "/content/objectstategroups/{$objectState->groupId}");
        $visitor->visit($this->getVisitorMock(), $generator, $objectState);
        $result = $generator->endDocument(null);
        $this->assertNotNull($result);
        return $result;
    }