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

testParse() public method

Tests the UserGroupCreate parser.
public testParse ( )
    public function testParse()
    {
        $inputArray = array('ContentType' => array('_href' => '/content/types/3'), 'mainLanguageCode' => 'eng-US', 'Section' => array('_href' => '/content/sections/4'), 'remoteId' => 'remoteId12345678', 'fields' => array('field' => array(array('fieldDefinitionIdentifier' => 'name', 'fieldValue' => array()))));
        $userGroupCreate = $this->getParser();
        $result = $userGroupCreate->parse($inputArray, $this->getParsingDispatcherMock());
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\User\\UserGroupCreateStruct', $result, 'UserGroupCreateStruct not created correctly.');
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\ContentType\\ContentType', $result->contentType, 'contentType not created correctly.');
        $this->assertEquals(3, $result->contentType->id, 'contentType not created correctly');
        $this->assertEquals('eng-US', $result->mainLanguageCode, 'mainLanguageCode not created correctly');
        $this->assertEquals(4, $result->sectionId, 'sectionId not created correctly');
        $this->assertEquals('remoteId12345678', $result->remoteId, 'remoteId not created correctly');
        foreach ($result->fields as $field) {
            $this->assertEquals('foo', $field->value, 'field value not created correctly');
        }
    }