diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Security/Authorization/AbstractStoredObjectVoterTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Security/Authorization/AbstractStoredObjectVoterTest.php index 4f420223a..3f6a5538d 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Security/Authorization/AbstractStoredObjectVoterTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Security/Authorization/AbstractStoredObjectVoterTest.php @@ -143,10 +143,26 @@ class AbstractStoredObjectVoterTest extends TestCase $voter = $this->buildStoredObjectVoter(true, $this->repository, $this->security, $this->workflowDocumentService); // Test voteOnAttribute method - $attribute = StoredObjectRoleEnum::SEE; + $attribute = StoredObjectRoleEnum::EDIT; $result = $voter->voteOnAttribute($attribute, $subject, $token); // Assert that access is denied when workflow is not allowed $this->assertFalse($result); } + + public function testVoteOnAttributeAllowedWorkflowAllowedToSeeDocument(): void + { + list($user, $token, $subject, $entity) = $this->setupMockObjects(); + + // Setup mocks for voteOnAttribute method + $this->setupMocksForVoteOnAttribute($user, $token, true, $entity, false); + $voter = $this->buildStoredObjectVoter(true, $this->repository, $this->security, $this->workflowDocumentService); + + // Test voteOnAttribute method + $attribute = StoredObjectRoleEnum::SEE; + $result = $voter->voteOnAttribute($attribute, $subject, $token); + + // Assert that access is denied when workflow is not allowed + $this->assertTrue($result); + } }