/** * @test */ public function updateAndDeleteProcessVariables() { $restClient = new camundaRestClient(self::$restApi); $pi = $restClient->getProcessInstances()[0]; $piv = array('value' => 'testValue', 'type' => 'String'); $restClient->putSingleProcessVariable($pi->id, 'testVariable', $piv); $piv = array('value' => 'testValue2', 'type' => 'String'); $restClient->putSingleProcessVariable($pi->id, 'testVariable2', $piv); $piv = array(); $pm = array(); $pm['testVariable'] = array('value' => 'newTestValue'); $pm['testVariable2'] = array('value' => 'newTestValue2'); $piv['modifications'] = $pm; $restClient->updateOrRemoveProcessVariables($pi->id, $piv); $this->assertEquals('newTestValue', $restClient->getSingleProcessVariable($pi->id, 'testVariable')->value); $this->assertEquals('newTestValue2', $restClient->getSingleProcessVariable($pi->id, 'testVariable2')->value); $pvc = count(get_object_vars($restClient->getProcessVariables($pi->id))); $piv = array(); $pm = array('testVariable', 'testVariable2'); $piv['deletions'] = $pm; $restClient->updateOrRemoveProcessVariables($pi->id, $piv); $this->assertEquals($pvc - 2, count(get_object_vars($restClient->getProcessVariables($pi->id)))); }