File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
src/Magento/FunctionalTestingFramework/DataTransport/Auth/Tfa Expand file tree Collapse file tree 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)
5757 throw new TestFrameworkException ('Unable to get OTP ' . PHP_EOL . $ e ->getMessage ());
5858 }
5959
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+ );
6168 self ::$ totps [$ path ]->setIssuer ('MFTF ' );
6269 self ::$ totps [$ path ]->setLabel ('MFTF Testing ' );
6370 }
You can’t perform that action at this time.
0 commit comments