SimpleAttributeEnricherTest::testProcess()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 12
rs 9.9666
1
<?php
2
declare(strict_types=1);
3
4
namespace DMK\MKSamlAuth\Tests\Unit\Enricher;
5
6
use DMK\MKSamlAuth\Enricher\SimpleAttributeEnricher;
7
use DMK\MKSamlAuth\Model\FrontendUser;
8
use PHPUnit\Framework\TestCase;
9
10
class SimpleAttributeEnricherTest extends TestCase
11
{
12
    /**
13
     * @var SimpleAttributeEnricher
14
     */
15
    private $enricher;
16
17
    protected function setUp()
18
    {
19
        $this->enricher = new SimpleAttributeEnricher();
20
    }
21
22
    public function testProcess()
23
    {
24
        $user = $this->prophesize(FrontendUser::class);
25
        $user->setProperty('first_name', 'foo')->shouldBeCalled();
26
        $user->setProperty('last_name', 'bar')->shouldBeCalled();
27
        $user->setProperty('email', 'foo@bar')->shouldBeCalled();
28
29
        $this->enricher->process($user->reveal(), [
30
            'attributes' => [
31
                'givenname' => 'foo',
32
                'sn' => 'bar',
33
                'mail' => 'foo@bar',
34
            ]
35
        ]);
36
    }
37
}
38