Completed
Branch master (c0d8ef)
by Yaroslav
06:36
created

SymfonySecurityTestTest::testMetadata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 11
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 *
5
 * (c) Yaroslav Honcharuk <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Yarhon\RouteGuardBundle\Tests\Security\Test;
12
13
use PHPUnit\Framework\TestCase;
14
use Yarhon\RouteGuardBundle\Security\Test\SymfonySecurityTest;
15
16
/**
17
 * @author Yaroslav Honcharuk <[email protected]>
18
 */
19
class SymfonySecurityTestTest extends TestCase
20
{
21
    public function testAttributes()
22
    {
23
        $test = new SymfonySecurityTest(['foo', 'bar']);
24
25
        $this->assertSame(['foo', 'bar'], $test->getAttributes());
26
    }
27
28
    public function testSubject()
29
    {
30
        $test = new SymfonySecurityTest([], 'foo');
31
32
        $this->assertSame('foo', $test->getSubject());
33
    }
34
35
    public function testMetadata()
36
    {
37
        $test = new SymfonySecurityTest([]);
38
39
        $self = $test->setMetadata('foo', 5);
40
41
        $this->assertSame($test, $self);
42
43
        $this->assertSame(5, $test->getMetadata('foo'));
44
45
        $this->assertNull($test->getMetadata('bar'));
46
    }
47
}
48