eZ\Publish\Core\REST\Server\Tests\Input\Parser\ViewInputOneDotOneTest::testParseLocationQuery PHP Method

testParseLocationQuery() public method

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