eZ\Publish\Core\REST\Common\Tests\Output\VisitorTest::testVisitDocument PHP Метод

testVisitDocument() публичный Метод

public testVisitDocument ( )
    public function testVisitDocument()
    {
        $data = new stdClass();
        $generator = $this->getMock('\\eZ\\Publish\\Core\\REST\\Common\\Output\\Generator');
        $generator->expects($this->at(1))->method('startDocument')->with($data);
        $generator->expects($this->at(2))->method('isEmpty')->will($this->returnValue(false));
        $generator->expects($this->at(3))->method('endDocument')->with($data)->will($this->returnValue('Hello world!'));
        $visitor = $this->getMock('\\eZ\\Publish\\Core\\REST\\Common\\Output\\Visitor', array('visitValueObject'), array($generator, $this->getValueObjectDispatcherMock()));
        $this->assertEquals(new Response('Hello world!', 200, array()), $visitor->visit($data));
    }