diff --git a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php index bf8ca0dc51b18..e93e07d768fdf 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php +++ b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php @@ -58,7 +58,12 @@ protected function setUp(): void parent::setUp(); $this->_objectManager->get(\Magento\Backend\Model\UrlInterface::class)->turnOffSecretKey(); - + /** + * Authorization can be created on test bootstrap... + * If it will be created on test bootstrap we will have invalid RoleLocator object. + * As tests by default are run not from adminhtml area... + */ + \Magento\TestFramework\ObjectManager::getInstance()->removeSharedInstance(\Magento\Framework\Authorization::class); $this->_auth = $this->_objectManager->get(\Magento\Backend\Model\Auth::class); $this->_session = $this->_auth->getAuthStorage(); $credentials = $this->_getAdminCredentials();