Failed Conditions
Push — ng ( a2b1ac...8ea883 )
by Florent
04:25
created

UserAccountCheckerManagerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A theUserAccountCheckerManagerCallsAllCheckers() 0 18 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * The MIT License (MIT)
7
 *
8
 * Copyright (c) 2014-2018 Spomky-Labs
9
 *
10
 * This software may be modified and distributed under the terms
11
 * of the MIT license.  See the LICENSE file for details.
12
 */
13
14
namespace OAuth2Framework\Component\AuthorizationEndpoint\Tests\UserAccount;
15
16
use OAuth2Framework\Component\AuthorizationEndpoint\Authorization;
17
use OAuth2Framework\Component\AuthorizationEndpoint\UserAccount\UserAccountChecker;
18
use OAuth2Framework\Component\AuthorizationEndpoint\UserAccount\UserAccountCheckerManager;
19
use PHPUnit\Framework\TestCase;
20
use Prophecy\Argument;
21
22
/**
23
 * @group UserAccountChecker
24
 * @group UserAccountCheckerManager
25
 */
26
class UserAccountCheckerManagerTest extends TestCase
27
{
28
    /**
29
     * @test
30
     */
31
    public function theUserAccountCheckerManagerCallsAllCheckers()
32
    {
33
        $checker1 = $this->prophesize(UserAccountChecker::class);
34
        $checker1->check(Argument::any())
35
            ->shouldBeCalled();
36
37
        $checker2 = $this->prophesize(UserAccountChecker::class);
38
        $checker2->check(Argument::any())
39
            ->shouldBeCalled();
40
41
        $authorization = $this->prophesize(Authorization::class);
42
43
        $manager = new UserAccountCheckerManager();
44
        $manager->add($checker1->reveal());
45
        $manager->add($checker2->reveal());
46
47
        $manager->check($authorization->reveal());
48
    }
49
}
50