File tree 2 files changed +32
-1
lines changed
src/Magento/FunctionalTestingFramework/DataTransport/Auth/Tfa
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \FunctionalTestingFramework \DataTransport \Auth \Tfa ;
9
+
10
+ use DateTimeImmutable ;
11
+ use Psr \Clock \ClockInterface ;
12
+
13
+ class Clock implements ClockInterface
14
+ {
15
+ /**
16
+ * Return DateTimeImmutable class object
17
+ *
18
+ * @return DateTimeImmutable
19
+ */
20
+ public function now (): DateTimeImmutable
21
+ {
22
+ return new DateTimeImmutable ();
23
+ }
24
+ }
Original file line number Diff line number Diff line change @@ -57,7 +57,14 @@ private static function create($path)
57
57
throw new TestFrameworkException ('Unable to get OTP ' . PHP_EOL . $ e ->getMessage ());
58
58
}
59
59
60
- self ::$ totps [$ path ] = TOTP ::create ($ secret );
60
+ self ::$ totps [$ path ] = TOTP ::create (
61
+ $ secret ,
62
+ TOTP ::DEFAULT_PERIOD ,
63
+ TOTP ::DEFAULT_DIGEST ,
64
+ TOTP ::DEFAULT_DIGITS ,
65
+ TOTP ::DEFAULT_EPOCH ,
66
+ new Clock ()
67
+ );
61
68
self ::$ totps [$ path ]->setIssuer ('MFTF ' );
62
69
self ::$ totps [$ path ]->setLabel ('MFTF Testing ' );
63
70
}
You can’t perform that action at this time.
0 commit comments