| @@ 121-127 (lines=7) @@ | ||
| 118 | } |
|
| 119 | } |
|
| 120 | ||
| 121 | public function testValidatePassword() |
|
| 122 | { |
|
| 123 | $model = Admin::findOne(1); |
|
| 124 | $model->validatePassword("1234"); |
|
| 125 | $this->assertFalse($model->validatePassword("1234")); |
|
| 126 | $this->assertTrue($model->validatePassword("1!an1u0")); |
|
| 127 | } |
|
| 128 | ||
| 129 | public function testGeneratePasswordResetToken() |
|
| 130 | { |
|
| @@ 136-142 (lines=7) @@ | ||
| 133 | $this->assertTrue($res); |
|
| 134 | } |
|
| 135 | ||
| 136 | public function testResetPassword() |
|
| 137 | { |
|
| 138 | $model = Admin::findOne(1); |
|
| 139 | $this->assertTrue($model->resetPassword('lian1uo')); |
|
| 140 | $this->assertTrue($model->validatePassword("lian1uo")); |
|
| 141 | $this->assertTrue($model->resetPassword('1!an1u0')); |
|
| 142 | } |
|
| 143 | ||
| 144 | public function testGenerateAuthKey() |
|
| 145 | { |
|