-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Update regex in ControllerAclTest #16697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Change regex in getControllerPath() to avoid classes which are under "Controller" namespace (like for example controller plugins) being interpreted as controllers causing the Act test to fail.
Hi @aleron75. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
@@ -232,7 +232,7 @@ private function isItTest($relativeFilePath) | |||
*/ | |||
private function getControllerPath($relativeFilePath) | |||
{ | |||
if (preg_match('~(Magento\/.*Controller\/Adminhtml\/.*)\.php~', $relativeFilePath, $matches)) { | |||
if (preg_match('~(Magento\/[^\/]+\/Controller\/Adminhtml\/.*)\.php~', $relativeFilePath, $matches)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but you need apply changes to 2.2-develop
first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created PR #16707 fir 2.2-develop, thanks
Hi @orlangur, thank you for the review. |
Hi @miguelbalparda, thank you for the review. |
Hi @aleron75. Thank you for your contribution. |
Description
Change regex in
ControllerAclTest::getControllerPath()
to avoid classes which are under a namespace with a "Controller" part (like for example controller plugins) being interpreted as controllers causing the Act test to fail.I need this change because, in the scope of MSI development, I have to define the following plugin for a controller:
The
Magento\InventoryCatalog\Plugin\Catalog\Controller\Adminhtml\Product\Initialization\StockDataFilter\AllowNegativeMinQtyPlugin
plugin class makes the test fail because it is considered a controller but doesn't extend\Magento\Backend\App\AbstractAction
.Manual testing scenarios
ControllerAclTest
static test