Passed
Push — master ( 7f699f...e24ab0 )
by Kirill
03:06
created

AllowRuleTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testAllow() 0 8 1
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Security\Rules;
13
14
use PHPUnit\Framework\TestCase;
15
use Spiral\Security\ActorInterface;
16
use Spiral\Security\RuleInterface;
17
use Spiral\Security\Rule\AllowRule;
18
19
/**
20
 * Class AllowRuleTest
21
 *
22
 * @package Spiral\Tests\Security\Rules
23
 */
24
class AllowRuleTest extends TestCase
25
{
26
    public const OPERATION = 'test';
27
    public const CONTEXT = [];
28
29
    public function testAllow(): void
30
    {
31
        /** @var RuleInterface $rule */
32
        $rule = new AllowRule();
33
        /** @var ActorInterface $actor */
34
        $actor = $this->createMock(ActorInterface::class);
35
36
        $this->assertTrue($rule->allows($actor, static::OPERATION, static::CONTEXT));
37
    }
38
}
39