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

testParse() public method

Tests the LocationUpdate parser.
public testParse ( )
    public function testParse()
    {
        $inputArray = array('priority' => 0, 'remoteId' => 'remote-id', 'hidden' => 'true', 'sortField' => 'PATH', 'sortOrder' => 'ASC');
        $locationUpdate = $this->getParser();
        $result = $locationUpdate->parse($inputArray, $this->getParsingDispatcherMock());
        $this->assertInstanceOf('\\eZ\\Publish\\Core\\REST\\Server\\Values\\RestLocationUpdateStruct', $result, 'LocationUpdateStruct not created correctly.');
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationUpdateStruct', $result->locationUpdateStruct, 'LocationUpdateStruct not created correctly.');
        $this->assertEquals(0, $result->locationUpdateStruct->priority, 'LocationUpdateStruct priority property not created correctly.');
        $this->assertEquals('remote-id', $result->locationUpdateStruct->remoteId, 'LocationUpdateStruct remoteId property not created correctly.');
        $this->assertEquals(true, $result->hidden, 'hidden property not created correctly.');
        $this->assertEquals(Location::SORT_FIELD_PATH, $result->locationUpdateStruct->sortField, 'LocationUpdateStruct sortField property not created correctly.');
        $this->assertEquals(Location::SORT_ORDER_ASC, $result->locationUpdateStruct->sortOrder, 'LocationUpdateStruct sortOrder property not created correctly.');
    }