Update regex in ControllerAclTest#16697
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 |
| 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.
LGTM, but you need apply changes to 2.2-develop first.
There was a problem hiding this comment.
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\AllowNegativeMinQtyPluginplugin class makes the test fail because it is considered a controller but doesn't extend\Magento\Backend\App\AbstractAction.Manual testing scenarios
ControllerAclTeststatic test