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

testParse() public method

Tests the LocationCreate parser.
public testParse ( )
    public function testParse()
    {
        $inputArray = array('ParentLocation' => array('_href' => '/content/locations/1/2/42'), 'priority' => '2', 'hidden' => 'true', 'remoteId' => 'remoteId12345678', 'sortField' => 'PATH', 'sortOrder' => 'ASC');
        $locationCreate = $this->getParser();
        $result = $locationCreate->parse($inputArray, $this->getParsingDispatcherMock());
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\Content\\LocationCreateStruct', $result, 'LocationCreateStruct not created correctly.');
        $this->assertEquals(42, $result->parentLocationId, 'LocationCreateStruct parentLocationId property not created correctly.');
        $this->assertEquals(2, $result->priority, 'LocationCreateStruct priority property not created correctly.');
        $this->assertEquals(true, $result->hidden, 'LocationCreateStruct hidden property not created correctly.');
        $this->assertEquals('remoteId12345678', $result->remoteId, 'LocationCreateStruct remoteId property not created correctly.');
        $this->assertEquals(Location::SORT_FIELD_PATH, $result->sortField, 'LocationCreateStruct sortField property not created correctly.');
        $this->assertEquals(Location::SORT_ORDER_ASC, $result->sortOrder, 'LocationCreateStruct sortOrder property not created correctly.');
    }