eZ\Publish\Core\Repository\Tests\Service\Integration\ObjectStateBase::testPartiallyUpdateObjectState PHP Method

testPartiallyUpdateObjectState() public method

Test service method for partially updating object state.
    public function testPartiallyUpdateObjectState()
    {
        $objectStateService = $this->repository->getObjectStateService();
        $stateUpdateStruct = $objectStateService->newObjectStateUpdateStruct();
        $stateUpdateStruct->identifier = 'test';
        $stateUpdateStruct->names = array('eng-US' => 'Test');
        $state = $objectStateService->loadObjectState(1);
        $updatedState = $objectStateService->updateObjectState($state, $stateUpdateStruct);
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\ObjectState\\ObjectState', $updatedState);
        $this->assertPropertiesCorrect(array('id' => 1, 'identifier' => 'test', 'priority' => 0, 'defaultLanguageCode' => 'eng-US', 'languageCodes' => array('eng-US'), 'names' => array('eng-US' => 'Test'), 'descriptions' => array('eng-US' => '')), $updatedState);
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\ObjectState\\ObjectStateGroup', $updatedState->getObjectStateGroup());
        $this->assertEquals($state->getObjectStateGroup()->id, $updatedState->getObjectStateGroup()->id);
    }