File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
app/code/Magento/User/Test/Unit/Model/Backend/Config Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,28 @@ protected function setUp()
63
63
);
64
64
}
65
65
66
+ /**
67
+ * Test when admin password lifetime = 0 days
68
+ */
69
+ public function testIsLatestPasswordExpiredWhenNoAdminLifeTime ()
70
+ {
71
+ $ this ->backendConfigMock ->expects (self ::any ())->method ('getValue ' )
72
+ ->with (self ::XML_ADMIN_SECURITY_PASSWORD_LIFETIME )
73
+ ->willReturn ('0 ' );
74
+ $ this ->assertEquals (false , $ this ->model ->_isLatestPasswordExpired ([]));
75
+ }
76
+
77
+ /**
78
+ * Test when admin password lifetime = 2 days
79
+ */
80
+ public function testIsLatestPasswordExpiredWhenHasAdminLifeTime ()
81
+ {
82
+ $ this ->backendConfigMock ->expects (self ::any ())->method ('getValue ' )
83
+ ->with (self ::XML_ADMIN_SECURITY_PASSWORD_LIFETIME )
84
+ ->willReturn ('2 ' );
85
+ $ this ->assertEquals (true , $ this ->model ->_isLatestPasswordExpired (['last_updated ' => 1571428052 ]));
86
+ }
87
+
66
88
/**
67
89
* Test when security lockout threshold = 100 minutes
68
90
*/
You can’t perform that action at this time.
0 commit comments