| 1 | <?php |
||
| 19 | class TotpTest extends PHPUnit_Framework_TestCase |
||
| 20 | { |
||
| 21 | /** @var Totp */ |
||
| 22 | private $totp; |
||
| 23 | |||
| 24 | public function setUp() |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @expectedException \SURFnet\VPN\Server\Exception\TotpException |
||
| 42 | * @expectedExceptionMessage too many attempts at TOTP |
||
| 43 | */ |
||
| 44 | public function testTooManyReplays() |
||
| 55 | } |
||
| 56 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: