Completed
Push — master ( 336397...b90ae0 )
by Simon
01:36
created

MockYubiValidate   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A check() 0 16 1
1
<?php
2
3
namespace Firesphere\YubiAuth\Tests;
4
5
use Yubikey\Response;
6
use Yubikey\ResponseCollection;
7
use Yubikey\Validate;
8
9
10
class MockYubiValidate extends Validate
11
{
12
13
    public function check($otp, $multi = false)
14
    {
15
        $nonce = $this->generateNonce();
16
        $result = new Response(array(
17
            'h' => '',
18
            'otp' => $otp,
19
            'status' => 'OK',
20
            'nonce' => $nonce,
21
            'inputNonce' => $nonce,
22
            'inputOtp' => $otp,
23
            'host' => 'api.yubico.com',
24
            'sl' => 25,
25
            'timestamp' => time()
26
        ));
27
        return new ResponseCollection(array($result));
28
    }
29
30
}