mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-01 17:38:38 +00:00
Add IsGranted to TagController
This commit is contained in:
parent
4a1598165f
commit
943bfd9162
13 changed files with 310 additions and 41 deletions
|
@ -188,4 +188,32 @@ class EntryVoterTest extends TestCase
|
|||
|
||||
$this->assertSame(VoterInterface::ACCESS_GRANTED, $this->entryVoter->vote($this->token, $this->entry, [EntryVoter::CREATE_ANNOTATIONS]));
|
||||
}
|
||||
|
||||
public function testVoteReturnsDeniedForNonEntryUserTag(): void
|
||||
{
|
||||
$this->token->method('getUser')->willReturn(new User());
|
||||
|
||||
$this->assertSame(VoterInterface::ACCESS_DENIED, $this->entryVoter->vote($this->token, $this->entry, [EntryVoter::TAG]));
|
||||
}
|
||||
|
||||
public function testVoteReturnsGrantedForEntryUserTag(): void
|
||||
{
|
||||
$this->token->method('getUser')->willReturn($this->user);
|
||||
|
||||
$this->assertSame(VoterInterface::ACCESS_GRANTED, $this->entryVoter->vote($this->token, $this->entry, [EntryVoter::TAG]));
|
||||
}
|
||||
|
||||
public function testVoteReturnsDeniedForNonEntryUserUntag(): void
|
||||
{
|
||||
$this->token->method('getUser')->willReturn(new User());
|
||||
|
||||
$this->assertSame(VoterInterface::ACCESS_DENIED, $this->entryVoter->vote($this->token, $this->entry, [EntryVoter::UNTAG]));
|
||||
}
|
||||
|
||||
public function testVoteReturnsGrantedForEntryUserUntag(): void
|
||||
{
|
||||
$this->token->method('getUser')->willReturn($this->user);
|
||||
|
||||
$this->assertSame(VoterInterface::ACCESS_GRANTED, $this->entryVoter->vote($this->token, $this->entry, [EntryVoter::UNTAG]));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue