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

testParse() public method

Tests the ContentTypeUpdate parser.
public testParse ( )
    public function testParse()
    {
        $inputArray = $this->getInputArray();
        $contentTypeUpdate = $this->getParser();
        $result = $contentTypeUpdate->parse($inputArray, $this->getParsingDispatcherMock());
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\ContentType\\ContentTypeUpdateStruct', $result, 'ContentTypeUpdateStruct not created correctly.');
        $this->assertEquals('updated_content_type', $result->identifier, 'identifier not created correctly');
        $this->assertEquals('eng-US', $result->mainLanguageCode, 'mainLanguageCode not created correctly');
        $this->assertEquals('remote123456', $result->remoteId, 'remoteId not created correctly');
        $this->assertEquals('<title>', $result->urlAliasSchema, 'urlAliasSchema not created correctly');
        $this->assertEquals('<title>', $result->nameSchema, 'nameSchema not created correctly');
        $this->assertEquals(true, $result->isContainer, 'isContainer not created correctly');
        $this->assertEquals(Location::SORT_FIELD_PATH, $result->defaultSortField, 'defaultSortField not created correctly');
        $this->assertEquals(Location::SORT_ORDER_ASC, $result->defaultSortOrder, 'defaultSortOrder not created correctly');
        $this->assertEquals(true, $result->defaultAlwaysAvailable, 'defaultAlwaysAvailable not created correctly');
        $this->assertEquals(array('eng-US' => 'Updated content type'), $result->names, 'names not created correctly');
        $this->assertEquals(array('eng-US' => 'Updated content type description'), $result->descriptions, 'descriptions not created correctly');
        $this->assertEquals(new \DateTime('2012-12-31T12:30:00'), $result->modificationDate, 'creationDate not created correctly');
        $this->assertEquals(14, $result->modifierId, 'creatorId not created correctly');
    }