|
35 | 35 | use OCP\IL10N; |
36 | 36 | use OCP\IUserManager; |
37 | 37 | use OCP\Notification\IManager as INotificationManager; |
38 | | - |
39 | 38 | use OCP\Security\ICrypto; |
40 | 39 | use OCP\Share\IManager as IShareManager; |
41 | | - |
42 | 40 | use OCP\Share\IShare; |
43 | | - |
44 | 41 | use OCP\SystemTag\ISystemTagManager; |
45 | 42 | use OCP\SystemTag\ISystemTagObjectMapper; |
46 | | - |
47 | 43 | use Psr\Log\LoggerInterface; |
48 | 44 |
|
49 | 45 | class ApprovalServiceTest extends TestCase { |
@@ -410,24 +406,24 @@ public function testApproval() { |
410 | 406 | // approve failures |
411 | 407 | // tag does not exist |
412 | 408 | $this->ruleService->saveRule($idRule3, $idTagPending3, -1, $idTagRejected3, $approvers, $requesters, $description); |
413 | | - $result = $this->approvalService->approve($fileToReject->getId(), 'user1'); |
| 409 | + $result = $this->approvalService->approve($fileToReject->getId(), 'user1', $fileToReject->getEtag()); |
414 | 410 | $this->assertFalse($result); |
415 | 411 | $this->ruleService->saveRule($idRule3, $idTagPending3, $idTagApproved3, $idTagRejected3, $approvers, $requesters, $description); |
416 | 412 |
|
417 | 413 | // approve |
418 | | - $this->approvalService->approve($fileToApprove->getId(), 'user1'); |
| 414 | + $this->approvalService->approve($fileToApprove->getId(), 'user1', $fileToApprove->getEtag()); |
419 | 415 | $stateForUser1 = $this->approvalService->getApprovalState($fileToApprove->getId(), 'user1'); |
420 | 416 | $this->assertEquals(Application::STATE_APPROVED, $stateForUser1['state']); |
421 | 417 |
|
422 | 418 | // reject failures |
423 | 419 | // tag does not exist |
424 | 420 | $this->ruleService->saveRule($idRule3, $idTagPending3, $idTagApproved3, -1, $approvers, $requesters, $description); |
425 | | - $result = $this->approvalService->reject($fileToReject->getId(), 'user1'); |
| 421 | + $result = $this->approvalService->reject($fileToReject->getId(), 'user1', $fileToReject->getEtag()); |
426 | 422 | $this->assertFalse($result); |
427 | 423 | $this->ruleService->saveRule($idRule3, $idTagPending3, $idTagApproved3, $idTagRejected3, $approvers, $requesters, $description); |
428 | 424 |
|
429 | 425 | // reject |
430 | | - $this->approvalService->reject($fileToReject->getId(), 'user1'); |
| 426 | + $this->approvalService->reject($fileToReject->getId(), 'user1', $fileToReject->getEtag()); |
431 | 427 | $stateForUser1 = $this->approvalService->getApprovalState($fileToReject->getId(), 'user1'); |
432 | 428 | $this->assertEquals(Application::STATE_REJECTED, $stateForUser1['state']); |
433 | 429 | } |
|
0 commit comments