| @@ 58-70 (lines=13) @@ | ||
| 55 | * @expectedException \SURFnet\VPN\Server\Exception\TwoFactorException |
|
| 56 | * @expectedExceptionMessage invalid OTP key |
|
| 57 | */ |
|
| 58 | public function testTwoFactorWrongKey() |
|
| 59 | { |
|
| 60 | $c = new TwoFactor(__DIR__, $this->otpLog); |
|
| 61 | $c->twoFactor( |
|
| 62 | [ |
|
| 63 | 'INSTANCE_ID' => 'vpn.example', |
|
| 64 | 'POOL_ID' => 'internet', |
|
| 65 | 'common_name' => 'foo_xyz', |
|
| 66 | 'username' => 'totp', |
|
| 67 | 'password' => '999999', |
|
| 68 | ] |
|
| 69 | ); |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| 73 | * @expectedException \SURFnet\VPN\Server\Exception\TwoFactorException |
|
| @@ 107-119 (lines=13) @@ | ||
| 104 | * @expectedException \SURFnet\VPN\Server\Exception\TwoFactorException |
|
| 105 | * @expectedExceptionMessage no OTP secret registered |
|
| 106 | */ |
|
| 107 | public function testTwoFactorNotEnrolled() |
|
| 108 | { |
|
| 109 | $c = new TwoFactor(__DIR__, $this->otpLog); |
|
| 110 | $c->twoFactor( |
|
| 111 | [ |
|
| 112 | 'INSTANCE_ID' => 'vpn.example', |
|
| 113 | 'POOL_ID' => 'internet', |
|
| 114 | 'common_name' => 'bar_xyz', |
|
| 115 | 'username' => 'totp', |
|
| 116 | 'password' => '999999', |
|
| 117 | ] |
|
| 118 | ); |
|
| 119 | } |
|
| 120 | } |
|
| 121 | ||