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

testParse() public method

Tests the ObjectStateCreate parser.
public testParse ( )
    public function testParse()
    {
        $inputArray = array('identifier' => 'test-state', 'priority' => '0', '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'))));
        $objectStateCreate = $this->getParser();
        $result = $objectStateCreate->parse($inputArray, $this->getParsingDispatcherMock());
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\ObjectState\\ObjectStateCreateStruct', $result, 'ObjectStateCreateStruct not created correctly.');
        $this->assertEquals('test-state', $result->identifier, 'ObjectStateCreateStruct identifier property not created correctly.');
        $this->assertEquals(0, $result->priority, 'ObjectStateCreateStruct priority property not created correctly.');
        $this->assertEquals('eng-GB', $result->defaultLanguageCode, 'ObjectStateCreateStruct defaultLanguageCode property not created correctly.');
        $this->assertEquals(array('eng-GB' => 'Test state'), $result->names, 'ObjectStateCreateStruct names property not created correctly.');
        $this->assertEquals(array('eng-GB' => 'Test description'), $result->descriptions, 'ObjectStateCreateStruct descriptions property not created correctly.');
    }