-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensured that the tests can be run when the plugin is installed in /ve…
…ndor
- Loading branch information
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Kiwee\KiweeDemo\Test; | ||
|
||
use Shopware\Core\TestBootstrapper as BaseTestBootstrapper; | ||
|
||
class TestBootstrapper extends BaseTestBootstrapper | ||
{ | ||
#[Override] | ||
public function getPluginPath(string $pluginName): ?string | ||
{ | ||
$pluginDirectories = \glob($this->getProjectDir() . '/custom/*plugins/*', \GLOB_ONLYDIR) ?: []; | ||
$vendorDirectories = \glob($this->getProjectDir() . '/vendor/kiwee/shopware-demo-plugin', \GLOB_ONLYDIR) ?: []; | ||
$allPluginDirectories = array_merge($pluginDirectories, $vendorDirectories); | ||
|
||
foreach ($allPluginDirectories as $pluginDir) { | ||
if (!is_file($pluginDir . '/composer.json')) { | ||
continue; | ||
} | ||
|
||
if (!is_file($pluginDir . '/src/' . $pluginName . '.php')) { | ||
continue; | ||
} | ||
|
||
return $pluginDir; | ||
} | ||
|
||
return null; | ||
} | ||
} |