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

testVisit() public method

Test the Exception visitor.
public testVisit ( ) : string
return string
    public function testVisit()
    {
        $visitor = $this->getVisitor();
        $generator = $this->getGenerator();
        $generator->startDocument(null);
        $previousException = new \Exception('Sub-test');
        $exception = new \Exception('Test', 0, $previousException);
        $this->getVisitorMock()->expects($this->once())->method('visitValueObject')->with($previousException);
        $visitor->visit($this->getVisitorMock(), $generator, $exception);
        $result = $generator->endDocument(null);
        $this->assertNotNull($result);
        return $result;
    }