| Total Complexity | 5 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class U2fAuthenticationRequiredEventTest extends TestCase |
||
| 19 | { |
||
| 20 | private $event; |
||
| 21 | private $user; |
||
| 22 | |||
| 23 | public function setUp() |
||
| 24 | { |
||
| 25 | $this->user = $this->getMockForAbstractClass(U2fUser::class); |
||
| 26 | |||
| 27 | $this->event = new U2fAuthenticationRequiredEvent($this->user); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function testName() |
||
| 31 | { |
||
| 32 | $name = 'u2f.authentication.required'; |
||
| 33 | |||
| 34 | $this->assertEquals(U2fAuthenticationRequiredEvent::getName(), $name); |
||
| 35 | $this->assertEquals($this->event->getName(), $name); |
||
| 36 | } |
||
| 37 | |||
| 38 | public function testUser() |
||
| 39 | { |
||
| 40 | $this->assertEquals($this->event->getUser(), $this->user); |
||
| 41 | } |
||
| 42 | |||
| 43 | public function testMustAuthenticate() |
||
| 44 | { |
||
| 45 | $this->assertTrue($this->event->mustAuthenticate()); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function testAbort() |
||
| 49 | { |
||
| 50 | $this->event->abort(); |
||
| 51 | $this->assertFalse($this->event->mustAuthenticate()); |
||
| 52 | } |
||
| 54 |