PlatformRepository example

class EnvironmentRequirementsValidatorTest extends TestCase
{
    /** * @param array<string, string> $composerOverrides * @param array<string, Link> $requires * @param SystemCheck[] $expectedChecks * * @dataProvider composerRequirementsProvider */
    public function testValidateRequirements(?string $coreComposerName, array $composerOverrides, array $requires, array $expectedChecks): void
    {
        $systemEnvironment = new PlatformRepository([]$composerOverrides);

        $corePackage = new RootPackage($coreComposerName ?? 'shopware/platform', '1.0.0', '1.0.0');
        $corePackage->setRequires($requires);

        $repoManagerMock = $this->createMock(RepositoryManager::class);

        if ($coreComposerName) {
            $repoManagerMock->method('getLocalRepository')->willReturn(
                new InstalledArrayRepository([$corePackage])
            );
        } else {
            

    private function checkComposerDependencies(
        array $pluginDependencies,
        RequirementExceptionStack $exceptionStack,
        Composer $composer
    ): array {
        $packages = $composer->getRepositoryManager()->getLocalRepository()->getPackages();

        // Get PHP extension "packages"         $packages = array_merge(
            $packages,
            (new PlatformRepository())->getPackages(),
        );

        // add root package         $packages[] = $composer->getPackage();

        foreach ($packages as $package) {
            // Ignore Shopware plugins. They are checked separately in `validateInstalledPlugins`             if ($package->getType() === PluginFinder::COMPOSER_TYPE) {
                continue;
            }

            
Home | Imprint | This part of the site doesn't use cookies.