Skip to content

Commit

Permalink
Pending changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Oct 16, 2023
1 parent f9e9307 commit 7efd752
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ComponentCollector/AbstractComponentCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ protected function findComponentsByModuleName(string $content, bool $hardRequire
if (!preg_match_all('/([A-Za-z0-9]+)_([A-Za-z0-9]+)::/', $content, $matches)) {
return [];
}


$components = [];
foreach ($matches[0] as $matchIndex => $match) {
$moduleName = $matches[1][$matchIndex] . '_' . $matches[2][$matchIndex];
$components[] = $this->componentFactory->createByModuleName($moduleName, $hardRequirement);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Magento\Framework\App\ObjectManager;
use PHPUnit\Framework\TestCase;
use Yireo\ExtensionChecker\ComponentDetector\ModuleXmlComponentDetector;
use Yireo\ExtensionChecker\ComponentDetector\PhpClassComponentDetector;
use Yireo\ExtensionChecker\Test\Integration\Behaviour\AssertContainsByComponentName;

Expand All @@ -13,7 +14,7 @@ class ModuleXmlComponentDetectorTest extends TestCase

public function testGetComponentsByModuleName()
{
$componentDetector = ObjectManager::getInstance()->get(PhpClassComponentDetector::class);
$componentDetector = ObjectManager::getInstance()->get(ModuleXmlComponentDetector::class);
$components = $componentDetector->getComponentsByModuleName('Magento_Catalog');
$this->assertNotEmpty($components);
$this->assertContainsByComponentName('Magento_Checkout', $components);
Expand Down

0 comments on commit 7efd752

Please sign in to comment.