eZ\Publish\Core\Repository\Tests\Service\Integration\ObjectStateBase::testUpdateObjectState PHP Метод

testUpdateObjectState() публичный Метод

Test service method for updating object state.
    public function testUpdateObjectState()
    {
        $objectStateService = $this->repository->getObjectStateService();
        $stateUpdateStruct = $objectStateService->newObjectStateUpdateStruct();
        $stateUpdateStruct->identifier = 'test';
        $stateUpdateStruct->defaultLanguageCode = 'eng-GB';
        $stateUpdateStruct->names = array('eng-GB' => 'Test');
        $stateUpdateStruct->descriptions = array('eng-GB' => 'Test description');
        $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-GB', 'languageCodes' => array('eng-GB'), 'names' => array('eng-GB' => 'Test'), 'descriptions' => array('eng-GB' => 'Test description')), $updatedState);
        $this->assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\ObjectState\\ObjectStateGroup', $updatedState->getObjectStateGroup());
        $this->assertEquals($state->getObjectStateGroup()->id, $updatedState->getObjectStateGroup()->id);
    }