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

MockYubiValidate::check()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 13
nc 1
nop 2
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
}