/**
  * Constructor
  *
  * @param MagentoComposerApplicationFactory $applicationFactory
  * @param \Magento\Framework\Filesystem $filesystem
  * @param ComposerInformation $composerInformation
  * @param ObjectManagerProvider $objectManagerProvider
  * @throws \Exception
  */
 public function __construct(MagentoComposerApplicationFactory $applicationFactory, Filesystem $filesystem, ComposerInformation $composerInformation, ObjectManagerProvider $objectManagerProvider)
 {
     $this->application = $applicationFactory->create();
     $this->directory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
     $this->objectManager = $objectManagerProvider->get();
     $this->composerInformation = $composerInformation;
 }
 /**
  * Constructor
  *
  * @param MagentoComposerApplicationFactory $applicationFactory
  * @param \Magento\Framework\Filesystem $filesystem
  * @param \Magento\Framework\Stdlib\DateTime $dateTime
  * @param ComposerInformation $composerInformation
  * @throws \Exception
  */
 public function __construct(MagentoComposerApplicationFactory $applicationFactory, Filesystem $filesystem, DateTime $dateTime, ComposerInformation $composerInformation)
 {
     $this->application = $applicationFactory->create();
     $this->directory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
     $this->dateTime = $dateTime;
     $this->composerInformation = $composerInformation;
 }
 /**
  * Constructor
  *
  * @param MagentoComposerApplicationFactory $composerAppFactory
  * @param ComposerInformation $composerInfo
  */
 public function __construct(
     MagentoComposerApplicationFactory $composerAppFactory,
     ComposerInformation $composerInfo
 ) {
     $this->infoCommand = $composerAppFactory->createInfoCommand();
     $this->magentoComposerApplication = $composerAppFactory->create();
     $this->composerInfo = $composerInfo;
 }
 /**
  * Constructor
  *
  * @param ComposerJsonFinder $composerJsonFinder
  * @param DirectoryList $directoryList
  * @param File $file
  * @param MagentoComposerApplicationFactory $composerAppFactory
  */
 public function __construct(ComposerJsonFinder $composerJsonFinder, DirectoryList $directoryList, File $file, MagentoComposerApplicationFactory $composerAppFactory)
 {
     $this->composerJsonFinder = $composerJsonFinder;
     $this->directoryList = $directoryList;
     $this->file = $file;
     $this->requireUpdateDryRunCommand = $composerAppFactory->createRequireUpdateDryRunCommand();
     $this->magentoComposerApplication = $composerAppFactory->create();
 }
 /**
  * @param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator
  * @param \Magento\Framework\Composer\ComposerInformation $composerInformation
  * @param \Magento\Framework\HTTP\Client\Curl $curl
  * @param \Magento\Framework\Filesystem $filesystem
  * @param \Magento\Framework\Composer\MagentoComposerApplicationFactory $applicationFactory
  */
 public function __construct(\Zend\ServiceManager\ServiceLocatorInterface $serviceLocator, \Magento\Framework\Composer\ComposerInformation $composerInformation, \Magento\Framework\HTTP\Client\Curl $curl, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Composer\MagentoComposerApplicationFactory $applicationFactory)
 {
     $this->serviceLocator = $serviceLocator;
     $this->composerInformation = $composerInformation;
     $this->curlClient = $curl;
     $this->filesystem = $filesystem;
     $this->directory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
     $this->application = $applicationFactory->create();
 }
 public function __construct(ModuleListInterface $module_list, ResourceInterface $module_resource, Stacksight $stacksight, ComposerInformation $composerInformation, MagentoComposerApplicationFactory $magentoComposerApplicationFactory, PackageInfo $packageInfo, Stacksight $stacksight, UrlInterface $url)
 {
     $this->moduleList = $module_list;
     $this->moduleResource = $module_resource;
     $this->stacksight = $stacksight->getClient();
     $this->composerInformation = $composerInformation;
     $this->magentoComposerApplicationFactory = $magentoComposerApplicationFactory;
     $this->packageInfo = $packageInfo;
     $this->infoCommand = $magentoComposerApplicationFactory->createInfoCommand();
     $this->infoCommand = $magentoComposerApplicationFactory->createInfoCommand();
     $this->url = $url;
     parent::__construct();
 }
    /**
     * @param string $ceCurrentVersion
     * @param array $expectedResult
     *
     * @dataProvider getAllowedEnterpriseVersionsDataProvider
     */
    public function testGetAllowedEnterpriseVersions($ceCurrentVersion, $expectedResult)
    {
        $this->composerAppFactory->expects($this->once())
            ->method('createInfoCommand')
            ->willReturn($this->infoCommand);
        $this->systemPackage = new SystemPackage($this->composerAppFactory, $this->composerInformation);
        $this->infoCommand->expects($this->once())
            ->method('run')
            ->with('magento/product-enterprise-edition')
            ->willReturn(['available_versions' => ['1.0.0', '1.0.1', '1.0.2']]);
        $require = $this->getMock('\Composer\Package\Link', [], [], '', false);
        $constraintMock = $this->getMock('\Composer\Package\LinkConstraint\VersionConstraint', [], [], '', false);
        $constraintMock->expects($this->any())->method('getPrettyString')
            ->willReturn('1.0.1');
        $require->expects($this->any())
            ->method('getConstraint')
            ->willReturn($constraintMock);

        $this->composerInformation->expects($this->any())
            ->method('getPackageRequirements')
            ->willReturn(['magento/product-community-edition' => $require]);
        $this->assertEquals(
            $expectedResult,
            $this->systemPackage->getAllowedEnterpriseVersions($ceCurrentVersion)
        );
    }
Exemple #8
0
 /**
  * Run 'composer remove'
  *
  * @param array $packages
  * @throws \Exception
  *
  * @return string
  */
 public function remove(array $packages)
 {
     $composerApplication = $this->composerApplicationFactory->create();
     return $composerApplication->runComposerCommand(['command' => 'remove', 'packages' => $packages]);
 }
 /**
  * Constructor
  *
  * @param MagentoComposerApplicationFactory $applicationFactory
  * @throws \Exception
  */
 public function __construct(MagentoComposerApplicationFactory $applicationFactory)
 {
     $this->application = $applicationFactory->create();
     $this->composer = $this->application->createComposer();
     $this->locker = $this->composer->getLocker();
 }
 /**
  * @param ComposerInformation $composerInformation
  * @param MagentoComposerApplicationFactory $magentoComposerApplicationFactory
  */
 public function __construct(ComposerInformation $composerInformation, MagentoComposerApplicationFactory $magentoComposerApplicationFactory)
 {
     $this->composerInformation = $composerInformation;
     $this->infoCommand = $magentoComposerApplicationFactory->createInfoCommand();
 }