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

testParse() public method

Tests the ObjectStateUpdate parser.
public testParse ( )
    public function testParse()
    {
        $inputArray = array('identifier' => 'test-state', 'defaultLanguageCode' => 'eng-GB', 'names' => array('value' => array(array('_languageCode' => 'eng-GB', '#text' => 'Test state'))), 'descriptions' => array('value' => array(array('_languageCode' => 'eng-GB', '#text' => 'Test description'))));
        $objectStateUpdate = $this->getParser();
        $result = $objectStateUpdate->parse($inputArray, $this->getParsingDispatcherMock());
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\ObjectState\\ObjectStateUpdateStruct', $result, 'ObjectStateUpdateStruct not created correctly.');
        $this->assertEquals('test-state', $result->identifier, 'ObjectStateUpdateStruct identifier property not created correctly.');
        $this->assertEquals('eng-GB', $result->defaultLanguageCode, 'ObjectStateUpdateStruct defaultLanguageCode property not created correctly.');
        $this->assertEquals(array('eng-GB' => 'Test state'), $result->names, 'ObjectStateUpdateStruct names property not created correctly.');
        $this->assertEquals(array('eng-GB' => 'Test description'), $result->descriptions, 'ObjectStateUpdateStruct descriptions property not created correctly.');
    }