markshust / magento2-module-disabletwofactorauth

The DisableTwoFactorAuth module provides the ability to disable two-factor authentication.
MIT License
194 stars 39 forks source link

Removed newline character from MFTF config:show bool cast #10

Closed makao closed 3 years ago

makao commented 3 years ago
$webDriver->magentoCLI('config:show twofactorauth/general/enable')

If 2FA disabled, it returns "0\n" after cast to bool it gives true causing MFTF tests failure.

>>> (bool) "0"
=> false
>>> (bool) "0\n"
=> true

Simple replace should do the trick.

BorisovskiP commented 3 years ago

@markshust We also came across this issue. Could you have a look at it ?

norgeindian commented 3 years ago

Especially when the value is set only in the env.php, Magento returns /n, which also evaluates to true. So it would be great, if this could be merged, because currently all MFTF tests with an admin login are broken as soon as the module is active.

markshust commented 3 years ago

All merged, thanks for the PR! 👍

markshust commented 3 years ago

Tagged 1.1.4 which contains this update.