|
20 | 20 | use OCP\IL10N; |
21 | 21 | use OCP\IUserManager; |
22 | 22 | use OCP\Notification\IManager as INotificationManager; |
23 | | - |
24 | 23 | use OCP\Share\IManager as IShareManager; |
25 | | - |
26 | 24 | use OCP\Share\IShare; |
27 | | - |
28 | 25 | use OCP\SystemTag\ISystemTagManager; |
29 | 26 | use OCP\SystemTag\ISystemTagObjectMapper; |
30 | | - |
31 | 27 | use Psr\Log\LoggerInterface; |
32 | 28 |
|
33 | 29 | class ApprovalServiceTest extends TestCase { |
@@ -365,24 +361,24 @@ public function testApproval() { |
365 | 361 | // approve failures |
366 | 362 | // tag does not exist |
367 | 363 | $this->ruleService->saveRule($idRule3, $idTagPending3, -1, $idTagRejected3, $approvers, $requesters, $description, $unapproveWhenModified); |
368 | | - $result = $this->approvalService->approve($fileToReject->getId(), 'user1'); |
| 364 | + $result = $this->approvalService->approve($fileToReject->getId(), 'user1', $fileToReject->getEtag()); |
369 | 365 | $this->assertFalse($result); |
370 | 366 | $this->ruleService->saveRule($idRule3, $idTagPending3, $idTagApproved3, $idTagRejected3, $approvers, $requesters, $description, $unapproveWhenModified); |
371 | 367 |
|
372 | 368 | // approve |
373 | | - $this->approvalService->approve($fileToApprove->getId(), 'user1'); |
| 369 | + $this->approvalService->approve($fileToApprove->getId(), 'user1', $fileToApprove->getEtag()); |
374 | 370 | $stateForUser1 = $this->approvalService->getApprovalState($fileToApprove->getId(), 'user1'); |
375 | 371 | $this->assertEquals(Application::STATE_APPROVED, $stateForUser1['state']); |
376 | 372 |
|
377 | 373 | // reject failures |
378 | 374 | // tag does not exist |
379 | 375 | $this->ruleService->saveRule($idRule3, $idTagPending3, $idTagApproved3, -1, $approvers, $requesters, $description, $unapproveWhenModified); |
380 | | - $result = $this->approvalService->reject($fileToReject->getId(), 'user1'); |
| 376 | + $result = $this->approvalService->reject($fileToReject->getId(), 'user1', $fileToReject->getEtag()); |
381 | 377 | $this->assertFalse($result); |
382 | 378 | $this->ruleService->saveRule($idRule3, $idTagPending3, $idTagApproved3, $idTagRejected3, $approvers, $requesters, $description, $unapproveWhenModified); |
383 | 379 |
|
384 | 380 | // reject |
385 | | - $this->approvalService->reject($fileToReject->getId(), 'user1'); |
| 381 | + $this->approvalService->reject($fileToReject->getId(), 'user1', $fileToReject->getEtag()); |
386 | 382 | $stateForUser1 = $this->approvalService->getApprovalState($fileToReject->getId(), 'user1'); |
387 | 383 | $this->assertEquals(Application::STATE_REJECTED, $stateForUser1['state']); |
388 | 384 | } |
|
0 commit comments