| Total Complexity | 3 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class FrontendUserServiceTest extends UnitTestCase |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var FrontendUserService |
||
| 21 | */ |
||
| 22 | protected $subject; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Setup |
||
| 26 | * |
||
| 27 | * @return void |
||
| 28 | */ |
||
| 29 | public function setup() |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return array |
||
| 37 | */ |
||
| 38 | public function mustChangePasswordReturnsExpectedResultDataProvider() |
||
| 39 | { |
||
| 40 | return [ |
||
| 41 | 'no frontend user' => [ |
||
| 42 | [], |
||
| 43 | false |
||
| 44 | ], |
||
| 45 | 'must change password' => [ |
||
| 46 | [ |
||
| 47 | 'must_change_password' => 1, |
||
| 48 | 'password_expiry_date' => 0 |
||
| 49 | ], |
||
| 50 | true |
||
| 51 | ], |
||
| 52 | 'password expired' => [ |
||
| 53 | [ |
||
| 54 | 'must_change_password' => 0, |
||
| 55 | 'password_expiry_date' => 1538194307 |
||
| 56 | ], |
||
| 57 | true |
||
| 58 | ], |
||
| 59 | 'password not expired and no password change required' => [ |
||
| 60 | [ |
||
| 61 | 'must_change_password' => 0, |
||
| 62 | 'password_expiry_date' => 0 |
||
| 63 | ], |
||
| 64 | false |
||
| 65 | ], |
||
| 66 | ]; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @test |
||
| 71 | * @dataProvider mustChangePasswordReturnsExpectedResultDataProvider |
||
| 72 | */ |
||
| 73 | public function mustChangePasswordReturnsExpectedResult($feUserRecord, $expected) |
||
| 76 | } |
||
| 77 | } |
||
| 78 |