| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function testGetLoginPassword(): void |
||
| 22 | { |
||
| 23 | self::assertNull($this->repository->getLoginPassword('foo', 'bar', Site::Dilps), 'wrong user'); |
||
| 24 | self::assertNull($this->repository->getLoginPassword('administrator', 'bar', Site::Dilps), 'wrong password'); |
||
| 25 | |||
| 26 | $user = $this->repository->getLoginPassword('administrator', 'administrator', Site::Dilps); |
||
| 27 | self::assertNotNull($user); |
||
| 28 | self::assertSame(1000, $user->getId()); |
||
| 29 | |||
| 30 | $hash = _em()->getConnection()->executeQuery('SELECT password FROM `user` WHERE id = 1000')->fetchOne(); |
||
| 31 | self::assertStringStartsWith('$', $hash, 'password should have been re-hashed automatically'); |
||
| 32 | self::assertNotSame(md5('administrator'), $hash, 'password should have been re-hashed automatically'); |
||
| 33 | } |
||
| 35 |