mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-27 16:36:00 +00:00
Add IsGranted to import controllers
This commit is contained in:
parent
e3dc63f739
commit
9499b062d0
20 changed files with 71 additions and 17 deletions
|
@ -98,6 +98,20 @@ class MainVoterTest extends TestCase
|
|||
$this->assertSame(VoterInterface::ACCESS_GRANTED, $this->mainVoter->vote($this->token, null, [MainVoter::EXPORT_ENTRIES]));
|
||||
}
|
||||
|
||||
public function testVoteReturnsDeniedForNonUserImportEntries(): void
|
||||
{
|
||||
$this->security->method('isGranted')->with('ROLE_USER')->willReturn(false);
|
||||
|
||||
$this->assertSame(VoterInterface::ACCESS_DENIED, $this->mainVoter->vote($this->token, null, [MainVoter::IMPORT_ENTRIES]));
|
||||
}
|
||||
|
||||
public function testVoteReturnsGrantedForUserImportEntries(): void
|
||||
{
|
||||
$this->security->method('isGranted')->with('ROLE_USER')->willReturn(true);
|
||||
|
||||
$this->assertSame(VoterInterface::ACCESS_GRANTED, $this->mainVoter->vote($this->token, null, [MainVoter::IMPORT_ENTRIES]));
|
||||
}
|
||||
|
||||
public function testVoteReturnsDeniedForNonUserListSiteCredentials(): void
|
||||
{
|
||||
$this->security->method('isGranted')->with('ROLE_USER')->willReturn(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue