EcomDev_PHPUnit icon indicating copy to clipboard operation
EcomDev_PHPUnit copied to clipboard

Wrong Modulename detection in \EcomDev_PHPUnit_Model_App::getModuleNameByClassName

Open sgrund opened this issue 12 years ago • 3 comments

Modulename detection is not working correctly when Modules like these exists:

N98_Catalog N98_CatalogGrouped

        foreach ($this->getConfig()->getNode('modules')->children() as $module) {
            if (strpos($className, $module->getName()) === 0) {
               $moduleName = $module->getName();
               break;
            }
        }

By using strpos, the function will always return N98_Catalog.

sgrund avatar Apr 24 '13 07:04 sgrund

This should be :

if (strpos($className, $module->getName() . '_' ) === 0)

kezek avatar May 07 '13 09:05 kezek

@kezek Can you please create it as a pull request to dev branch, so you input will be mentioned in the contributions on github?

IvanChepurnyi avatar May 12 '13 18:05 IvanChepurnyi

Sorry Ivan , was away during that time but I see Sebastian took care of it so it's all good. Cheers

kezek avatar Aug 13 '13 22:08 kezek