7

Trying to Run all integration tests using ../../../vendor/bin/phpunit command.

Getting an error -

PHP Fatal error: Uncaught Error: Cannot instantiate interface Magento\TwoFactorAuth\Api\UserConfigManagerInterface

[Progress: 1276 / 1762]
Module 'Magento_TwoFactorAuth':
PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\TwoFactorAuth\Api\UserConfigManagerInterface in /var/www/html/ce241/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
Stack trace:
#0 /var/www/html/ce241/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject()
#1 /var/www/html/ce241/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#2 /var/www/html/ce241/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get()
#3 /var/www/html/ce241/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Compiled->create()
#4 /var/www/html/ce241/vendor/magento/framework/Setup/Patch/PatchApplier.php(149): Magento\Framework\ObjectManager\ObjectManager->create()
#5 /var/www/html/ce241/setup/src/Magento/Setup/Model/Installer.php(1081): Magento\F in /var/www/html/ce241/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121

I have disabled Magento_TwoFactorAuth module from main app/etc/config.php.
No other additional modules installed. Already checked permissions and ownership's of the respective directories.

2
  • 1
    Were you ever able to get this resolved?
    – Laura
    Feb 15, 2021 at 21:56
  • 4
    @Laura I had to re-enable Magento_TwoFactorAuth while executing integration test on my local. But you can use this https://github.com/markshust/magento2-module-disabletwofactorauth/tree/master/Test and add some integration test to \Test\Integration & make it work in that way. MFTF already there.
    – sandip
    Feb 17, 2021 at 13:18

1 Answer 1

1

For me I have the same issue if I have run setup:di:compile (i.e. generated code). The solution is to remove generated code. Enabling the module clears generated code, which is probably the reason why that seemingly works - integration tests ignore settings in app/etc/config.php.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.