eZ\Publish\Core\REST\Server\Tests\Input\Parser\ViewInputTest::testParse PHP Method

testParse() public method

Tests the ViewInput parser.
public testParse ( )
    public function testParse()
    {
        $inputArray = array('identifier' => 'Query identifier', 'Query' => []);
        $parser = $this->getParser();
        $parsingDispatcher = $this->getParsingDispatcherMock();
        $parsingDispatcher->expects($this->once())->method('parse')->with($inputArray['Query'], 'application/vnd.ez.api.internal.ContentQuery')->will($this->returnValue(new Query()));
        $result = $parser->parse($inputArray, $parsingDispatcher);
        $expectedViewInput = new RestViewInput();
        $expectedViewInput->identifier = 'Query identifier';
        $expectedViewInput->query = new Query();
        $this->assertEquals($expectedViewInput, $result, 'RestViewInput not created correctly.');
    }