public function testParseContentQuery() { $inputArray = array('identifier' => 'Query identifier', 'ContentQuery' => []); $parser = $this->getParser(); $parsingDispatcher = $this->getParsingDispatcherMock(); $parsingDispatcher->expects($this->once())->method('parse')->with($inputArray['ContentQuery'], '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.'); }