@@ -36,15 +36,18 @@ protected function setUp(): void {
3636 );
3737 }
3838
39- public function testRunWithNotExpiredToken (): void { // Affirm if updater.secret.created <48 hours ago then `updater.secret` is left alone
39+ /**
40+ * Affirm if updater.secret.created <48 hours ago then `updater.secret` is left alone.
41+ */
42+ public function testKeepSecretWhenCreatedRecently (): void {
4043 $ this ->timeFactory
4144 ->expects ($ this ->atLeastOnce ())
4245 ->method ('getTime ' )
4346 ->willReturn (1733069649 ); // "Sun, 01 Dec 2024 16:14:09 +0000"
4447 $ this ->appConfig
4548 ->expects ($ this ->once ())
4649 ->method ('getValueInt ' )
47- ->with ('core ' , 'updater.secret.created ' , 1733069649 )
50+ ->with ('core ' , 'updater.secret.created ' )
4851 ->willReturn (1733069649 - 1 * 24 * 60 * 60 ); // 24h prior: "Sat, 30 Nov 2024 16:14:09 +0000"
4952 $ this ->config
5053 ->expects ($ this ->once ())
@@ -64,18 +67,21 @@ public function testRunWithNotExpiredToken(): void { // Affirm if updater.secret
6467 ->expects ($ this ->once ())
6568 ->method ('debug ' );
6669
67- $ this -> invokePrivate ($ this ->resetTokenBackgroundJob , 'run ' , [null ]);
70+ static :: invokePrivate ($ this ->resetTokenBackgroundJob , 'run ' , [null ]);
6871 }
6972
70- public function testRunWithExpiredToken (): void { // Affirm if updater.secret.created >48 hours ago then `updater.secret` is removed
73+ /**
74+ * Affirm if updater.secret.created >48 hours ago then `updater.secret` is removed
75+ */
76+ public function testSecretIsRemovedWhenOutdated (): void {
7177 $ this ->timeFactory
7278 ->expects ($ this ->atLeastOnce ())
7379 ->method ('getTime ' )
7480 ->willReturn (1455045234 ); // "Tue, 09 Feb 2016 19:13:54 +0000"
7581 $ this ->appConfig
7682 ->expects ($ this ->once ())
7783 ->method ('getValueInt ' )
78- ->with ('core ' , 'updater.secret.created ' , 1455045234 )
84+ ->with ('core ' , 'updater.secret.created ' )
7985 ->willReturn (1455045234 - 3 * 24 * 60 * 60 ); // 72h prior: "Sat, 06 Feb 2016 19:13:54 +0000"
8086 $ this ->config
8187 ->expects ($ this ->once ())
@@ -102,8 +108,8 @@ public function testRunWithExpiredToken(): void { // Affirm if updater.secret.cr
102108
103109 public function testRunWithExpiredTokenAndReadOnlyConfigFile (): void { // Affirm if config_is_read_only is set that the secret is never reset
104110 $ this ->timeFactory
105- ->expects ($ this ->never ())
106- ->method ('getTime ' );
111+ ->expects ($ this ->never ())
112+ ->method ('getTime ' );
107113 $ this ->appConfig
108114 ->expects ($ this ->never ())
109115 ->method ('getValueInt ' );
0 commit comments