Passed
Push — master ( fb5c70...39865c )
by Simon
02:04
created

MockYubiValidateFalse::check()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 12
nc 1
nop 2
dl 0
loc 18
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Firesphere\YubiAuth\Tests;
4
5
use Yubikey\Response;
6
use Yubikey\ResponseCollection;
7
use Yubikey\Validate;
8
9
class MockYubiValidateFalse extends Validate
10
{
11
    public function check($otp, $multi = false)
12
    {
13
        $nonce = $this->generateNonce();
14
        $result = new Response(
15
            [
16
                'h'          => '',
17
                'otp'        => $otp,
18
                'status'     => 'REPLAYED_OTP',
19
                'nonce'      => $nonce,
20
                'inputNonce' => $nonce,
21
                'inputOtp'   => $otp,
22
                'host'       => 'api.yubico.com',
23
                'sl'         => 25,
24
                'timestamp'  => time()
25
            ]
26
        );
27
28
        return new ResponseCollection([$result]);
29
    }
30
}
31