Spomky-Labs / otphp

:closed_lock_with_key: A PHP library for generating one time passwords according to RFC 4226 (HOTP) and the RFC 6238 (TOTP)
MIT License
1.31k stars 150 forks source link

PSR Clock #186

Closed norkunas closed 1 year ago

norkunas commented 1 year ago

Description

I see that in TOTP time() is used many times. To ease testing PSR clock could be leveraged. Of course if there are other ways how to test the 2FA without clock mocking I'm all ears :)

Example

No response

Spomky commented 1 year ago

Hi,

Yes, that's a good idea!

Spomky commented 1 year ago

Hi,

You can test with the branch 11.3.x. Just let me know if you have any comments.

Regards.

norkunas commented 1 year ago

Nice, thank you.