php Magento-Setup-Model-ObjectManagerProvider类(方法)实例源码

下面列出了php Magento-Setup-Model-ObjectManagerProvider 类(方法)源码代码实例,从而了解它的用法。

作者:pradeep-wagent    项目:magento   
/**
  * 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;
 }

作者:andrewhowdenco    项目:m2onk8   
/**
  * Constructor
  *
  * @param ObjectManagerProvider $objectManagerProvider
  * @param \Magento\Framework\Composer\Remove $remove
  * @param UninstallCollector $collector
  * @param \Magento\Setup\Module\SetupFactory $setupFactory
  */
 public function __construct(ObjectManagerProvider $objectManagerProvider, \Magento\Framework\Composer\Remove $remove, UninstallCollector $collector, \Magento\Setup\Module\SetupFactory $setupFactory)
 {
     $this->objectManager = $objectManagerProvider->get();
     $this->remove = $remove;
     $this->collector = $collector;
     $this->setupFactory = $setupFactory;
 }

作者:kidaa3    项目:magento2-platforms   
/**
  * Constructor
  *
  * @param ObjectManagerProvider $objectManagerProvider
  * @param WebLogger $logger
  * @param DirectoryList $directoryList
  * @param Filesystem $fileSystem
  */
 public function __construct(ObjectManagerProvider $objectManagerProvider, WebLogger $logger, DirectoryList $directoryList, Filesystem $fileSystem)
 {
     $objectManager = $objectManagerProvider->get();
     $this->backupHandler = $objectManager->create('Magento\\Framework\\Setup\\BackupRollback', ['log' => $logger]);
     $this->directoryList = $directoryList;
     $this->fileSystem = $fileSystem;
 }

作者:andrewhowdenco    项目:m2onk8   
/**
  * Inject dependencies
  *
  * @param InstallerFactory $installerFactory
  * @param DeploymentConfig $deploymentConfig
  * @param ObjectManagerProvider $objectManagerProvider
  */
 public function __construct(InstallerFactory $installerFactory, DeploymentConfig $deploymentConfig, ObjectManagerProvider $objectManagerProvider)
 {
     $this->installerFactory = $installerFactory;
     $this->deploymentConfig = $deploymentConfig;
     $this->objectManager = $objectManagerProvider->get();
     parent::__construct();
 }

作者:Doabilit    项目:magento2de   
/**
  *  Constructor
  *
  * @param \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  * @param \Magento\Setup\Model\Cron\Status $status
  * @param array $name
  * @param array $params
  */
 public function __construct(\Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider, \Symfony\Component\Console\Output\OutputInterface $output, \Magento\Setup\Model\Cron\Status $status, $name, $params = [])
 {
     $this->cleanupFiles = $objectManagerProvider->get()->get('Magento\\Framework\\App\\State\\CleanupFiles');
     $this->cache = $objectManagerProvider->get()->get('Magento\\Framework\\App\\Cache');
     $this->output = $output;
     $this->status = $status;
     parent::__construct($output, $status, $objectManagerProvider, $name, $params);
 }

作者:Doabilit    项目:magento2de   
/**
  * Constructor
  *
  * @param ObjectManagerProvider $objectManagerProvider
  * @param MaintenanceMode $maintenanceMode
  * @param DeploymentConfig $deploymentConfig
  */
 public function __construct(ObjectManagerProvider $objectManagerProvider, MaintenanceMode $maintenanceMode, DeploymentConfig $deploymentConfig)
 {
     $this->objectManager = $objectManagerProvider->get();
     $this->maintenanceMode = $maintenanceMode;
     $this->backupRollbackFactory = $this->objectManager->get('Magento\\Framework\\Setup\\BackupRollbackFactory');
     $this->deploymentConfig = $deploymentConfig;
     parent::__construct();
 }

作者:kidaa3    项目:magento2-platforms   
/**
  * Constructor
  *
  * @param \Magento\Framework\Composer\ComposerInformation $composerInformation
  * @param Helper\ModuleUninstall $moduleUninstall
  * @param Helper\ThemeUninstall $themeUninstall
  * @param \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  * @param \Magento\Setup\Model\Cron\Queue $queue
  * @param \Magento\Setup\Model\Cron\Status $status
  * @param \Magento\Setup\Model\Updater $updater
  * @param string $name
  * @param array $params
  */
 public function __construct(\Magento\Framework\Composer\ComposerInformation $composerInformation, Helper\ModuleUninstall $moduleUninstall, Helper\ThemeUninstall $themeUninstall, \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider, \Symfony\Component\Console\Output\OutputInterface $output, \Magento\Setup\Model\Cron\Queue $queue, \Magento\Setup\Model\Cron\Status $status, \Magento\Setup\Model\Updater $updater, $name, $params = [])
 {
     $this->composerInformation = $composerInformation;
     $this->moduleUninstall = $moduleUninstall;
     $this->themeUninstall = $themeUninstall;
     $this->objectManager = $objectManagerProvider->get();
     $this->updater = $updater;
     $this->queue = $queue;
     parent::__construct($output, $status, $objectManagerProvider, $name, $params);
 }

作者:opexs    项目:magento   
/**
  * Constructor
  *
  * @param ModuleLoader $moduleLoader
  * @param DeploymentConfig $deploymentConfig
  * @param ObjectManagerProvider $objectManagerProvider
  */
 public function __construct(ModuleLoader $moduleLoader, DeploymentConfig $deploymentConfig, ObjectManagerProvider $objectManagerProvider)
 {
     $this->allModules = $moduleLoader->load();
     foreach (array_keys($this->allModules) as $module) {
         $this->allModules[$module]['selected'] = true;
         $this->allModules[$module]['disabled'] = true;
     }
     $this->deploymentConfig = $deploymentConfig;
     $this->dependencyChecker = $objectManagerProvider->get()->get('Magento\\Framework\\Module\\DependencyChecker');
 }

作者:whoopl    项目:magento2-testin   
/**
  * @param \Magento\Framework\Composer\ComposerInformation $composerInformation
  * @param \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider
  * @param \Magento\Setup\Model\ConnectManager $connectManager
  * @param \Magento\Setup\Model\UpdatePackagesCache $updatePackagesCache
  */
 public function __construct(\Magento\Framework\Composer\ComposerInformation $composerInformation, \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider, \Magento\Setup\Model\UpdatePackagesCache $updatePackagesCache, \Magento\Setup\Model\ConnectManager $connectManager)
 {
     $this->composerInformation = $composerInformation;
     $objectManager = $objectManagerProvider->get();
     $this->enabledModuleList = $objectManager->get('Magento\\Framework\\Module\\ModuleList');
     $this->fullModuleList = $objectManager->get('Magento\\Framework\\Module\\FullModuleList');
     $this->packageInfo = $objectManager->get('Magento\\Framework\\Module\\PackageInfoFactory')->create();
     $this->connectManager = $connectManager;
     $this->updatePackagesCache = $updatePackagesCache;
 }

作者:andrewhowdenco    项目:m2onk8   
public function setUp()
 {
     $this->moduleLoader = $this->getMock('Magento\\Framework\\Module\\ModuleList\\Loader', [], [], '', false);
     $this->dependencyChecker = $this->getMock('Magento\\Framework\\Module\\DependencyChecker', [], [], '', false);
     $this->deploymentConfig = $this->getMock('Magento\\Framework\\App\\DeploymentConfig', [], [], '', false);
     $this->objectManager = $this->getMockForAbstractClass('Magento\\Framework\\ObjectManagerInterface');
     $this->objectManagerProvider = $this->getMock('Magento\\Setup\\Model\\ObjectManagerProvider', [], [], '', false);
     $this->objectManagerProvider->expects($this->once())->method('get')->willReturn($this->objectManager);
     $this->objectManager->expects($this->once())->method('get')->willReturn($this->dependencyChecker);
 }

作者:whoopl    项目:magento2-testin   
public function setup()
 {
     $this->backupRollbackFactory = $this->getMock('Magento\\Framework\\Setup\\BackupRollbackFactory', [], [], '', false);
     $this->backupRollback = $this->getMock('\\Magento\\Framework\\Setup\\BackupRollback', [], [], '', false);
     $this->status = $this->getMock('Magento\\Setup\\Model\\Cron\\Status', [], [], '', false);
     $output = $this->getMockForAbstractClass('Symfony\\Component\\Console\\Output\\OutputInterface', [], '', false);
     $this->objectManagerProvider = $this->getMock('Magento\\Setup\\Model\\ObjectManagerProvider', [], [], '', false);
     $objectManager = $this->getMockForAbstractClass('Magento\\Framework\\ObjectManagerInterface', [], '', false);
     $this->objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager);
     $this->jobDbRollback = new JobDbRollback($this->backupRollbackFactory, $output, $this->status, $this->objectManagerProvider, 'setup:rollback', ['backup_file_name' => 'someFileName']);
 }

作者:Doabilit    项目:magento2de   
/**
  * Constructor
  *
  * @param DeploymentConfig $deploymentConfig
  * @param DirectoryList $directoryList
  * @param Manager $taskManager
  * @param ObjectManagerProvider $objectManagerProvider
  * @param Filesystem $filesystem
  * @param DriverInterface $fileDriver
  * @param \Magento\Framework\Component\ComponentRegistrar $componentRegistrar
  */
 public function __construct(DeploymentConfig $deploymentConfig, DirectoryList $directoryList, Manager $taskManager, ObjectManagerProvider $objectManagerProvider, Filesystem $filesystem, DriverInterface $fileDriver, ComponentRegistrar $componentRegistrar)
 {
     $this->deploymentConfig = $deploymentConfig;
     $this->directoryList = $directoryList;
     $this->objectManager = $objectManagerProvider->get();
     $this->taskManager = $taskManager;
     $this->filesystem = $filesystem;
     $this->fileDriver = $fileDriver;
     $this->componentRegistrar = $componentRegistrar;
     parent::__construct();
 }

作者:kidaa3    项目:magento2-platforms   
protected function setUp()
 {
     $this->objectManagerProvider = $this->getMock('Magento\\Setup\\Model\\ObjectManagerProvider', [], [], '', false);
     $objectManager = $this->getMockForAbstractClass('Magento\\Framework\\ObjectManagerInterface');
     $this->objectManagerProvider->expects($this->any())->method('get')->will($this->returnValue($objectManager));
     $this->status = $this->getMock('Magento\\Framework\\Module\\Status', [], [], '', false);
     $this->cache = $this->getMock('Magento\\Framework\\App\\Cache', [], [], '', false);
     $this->cleanupFiles = $this->getMock('Magento\\Framework\\App\\State\\CleanupFiles', [], [], '', false);
     $this->fullModuleList = $this->getMock('Magento\\Framework\\Module\\FullModuleList', [], [], '', false);
     $objectManager->expects($this->any())->method('get')->will($this->returnValueMap([['Magento\\Framework\\Module\\Status', $this->status], ['Magento\\Framework\\App\\Cache', $this->cache], ['Magento\\Framework\\App\\State\\CleanupFiles', $this->cleanupFiles], ['Magento\\Framework\\Module\\FullModuleList', $this->fullModuleList]]));
 }

作者:andrewhowdenco    项目:m2onk8   
/**
  * @param \Magento\Framework\Composer\ComposerInformation $composerInformation
  * @param \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider
  * @param \Magento\Setup\Model\MarketplaceManager $marketplaceManager
  * @param \Magento\Setup\Model\UpdatePackagesCache $updatePackagesCache
  */
 public function __construct(\Magento\Framework\Composer\ComposerInformation $composerInformation, \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider, \Magento\Setup\Model\UpdatePackagesCache $updatePackagesCache, \Magento\Setup\Model\MarketplaceManager $marketplaceManager)
 {
     $this->composerInformation = $composerInformation;
     $objectManager = $objectManagerProvider->get();
     $this->enabledModuleList = $objectManager->get('Magento\\Framework\\Module\\ModuleList');
     $this->fullModuleList = $objectManager->get('Magento\\Framework\\Module\\FullModuleList');
     $this->packageInfo = $objectManager->get('Magento\\Framework\\Module\\PackageInfoFactory')->create();
     $this->marketplaceManager = $marketplaceManager;
     $this->updatePackagesCache = $updatePackagesCache;
     $this->timezone = $objectManager->get('Magento\\Framework\\Stdlib\\DateTime\\TimezoneInterface');
 }

作者:whoopl    项目:magento2-testin   
public function setUp()
 {
     $this->serviceLocatorMock = $this->getMockForAbstractClass('Zend\\ServiceManager\\ServiceLocatorInterface', ['get']);
     $deploymentConfig = $this->getMock('Magento\\Framework\\App\\DeploymentConfig', [], [], '', false);
     $deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(false);
     $objectManager = $this->getMock('Magento\\Framework\\ObjectManagerInterface', [], [], '', false);
     $objectManager->expects($this->once())->method('get')->willReturn($deploymentConfig);
     $this->objectManagerProvider = $this->getMock('Magento\\Setup\\Model\\ObjectManagerProvider', [], [], '', false);
     $this->objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager);
     $this->serviceLocatorMock->expects($this->exactly(2))->method('get')->with('config')->will($this->returnValue(['navInstallerTitles' => ['install' => 'SomeTitle'], 'navInstaller' => [['key1' => 'value1'], ['key2' => 'value2'], ['nav' => 'abc', 'key3' => 'value3'], ['nav' => ''], ['nav' => false], ['main' => 'abc', 'key3' => 'value3'], ['main' => ''], ['main' => false]]]));
     $this->navigation = new Navigation($this->serviceLocatorMock, $this->objectManagerProvider);
 }

作者:whoopl    项目:magento2-testin   
/**
  * @param ServiceLocatorInterface $serviceLocator
  * @param ObjectManagerProvider $objectManagerProvider
  */
 public function __construct(ServiceLocatorInterface $serviceLocator, ObjectManagerProvider $objectManagerProvider)
 {
     $objectManager = $objectManagerProvider->get();
     if ($objectManager->get('Magento\\Framework\\App\\DeploymentConfig')->isAvailable()) {
         $this->navStates = $serviceLocator->get('config')[self::NAV_UPDATER];
         $this->navType = self::NAV_UPDATER;
         $this->titles = $serviceLocator->get('config')[self::NAV_UPDATER . 'Titles'];
     } else {
         $this->navStates = $serviceLocator->get('config')[self::NAV_INSTALLER];
         $this->navType = self::NAV_INSTALLER;
         $this->titles = $serviceLocator->get('config')[self::NAV_INSTALLER . 'Titles'];
     }
 }

作者:Doabilit    项目:magento2de   
protected function setUp()
 {
     $this->objectManagerProviderMock = $this->getMock('Magento\\Setup\\Model\\ObjectManagerProvider', [], [], '', false);
     $objectManager = $this->getMockForAbstractClass('Magento\\Framework\\ObjectManagerInterface');
     $this->objectManagerProviderMock->expects($this->any())->method('get')->will($this->returnValue($objectManager));
     $this->statusMock = $this->getMock('Magento\\Framework\\Module\\Status', [], [], '', false);
     $this->cacheMock = $this->getMock('Magento\\Framework\\App\\Cache', [], [], '', false);
     $this->cleanupFilesMock = $this->getMock('Magento\\Framework\\App\\State\\CleanupFiles', [], [], '', false);
     $this->fullModuleListMock = $this->getMock('Magento\\Framework\\Module\\FullModuleList', [], [], '', false);
     $this->deploymentConfigMock = $this->getMock(\Magento\Framework\App\DeploymentConfig::class, [], [], '', false);
     $this->generatedFiles = $this->getMock('\\Magento\\Framework\\Code\\GeneratedFiles', [], [], '', false);
     $objectManager->expects($this->any())->method('get')->will($this->returnValueMap([['Magento\\Framework\\Module\\Status', $this->statusMock], ['Magento\\Framework\\App\\Cache', $this->cacheMock], ['Magento\\Framework\\App\\State\\CleanupFiles', $this->cleanupFilesMock], ['Magento\\Framework\\Module\\FullModuleList', $this->fullModuleListMock]]));
 }

作者:whoopl    项目:magento2-testin   
public function testIndexAction()
 {
     $this->objectManager = $this->getMockForAbstractClass('Magento\\Framework\\ObjectManagerInterface');
     $this->objectManagerProvider = $this->getMock('Magento\\Setup\\Model\\ObjectManagerProvider', ['get'], [], '', false);
     $this->deploymentConfig = $this->getMock('Magento\\Framework\\App\\DeploymentConfig', [], [], '', false);
     $this->objectManagerProvider->expects($this->once())->method('get')->willReturn($this->objectManager);
     $this->objectManager->expects($this->once())->method('get')->willReturn($this->deploymentConfig);
     $this->deploymentConfig->expects($this->once())->method('isAvailable')->willReturn(false);
     /** @var $controller Index */
     $controller = new Index($this->objectManagerProvider);
     $viewModel = $controller->indexAction();
     $this->assertInstanceOf('Zend\\View\\Model\\ViewModel', $viewModel);
     $this->assertFalse($viewModel->terminate());
 }

作者:nja7    项目:magento   
/**
  * Constructor
  *
  * @param DeploymentConfig $deploymentConfig
  * @param DirectoryList $directoryList
  * @param Manager $taskManager
  * @param ObjectManagerProvider $objectManagerProvider
  * @param Filesystem $filesystem
  */
 public function __construct(
     DeploymentConfig $deploymentConfig,
     DirectoryList $directoryList,
     Manager $taskManager,
     ObjectManagerProvider $objectManagerProvider,
     Filesystem $filesystem
 ) {
     $this->deploymentConfig = $deploymentConfig;
     $this->directoryList    = $directoryList;
     $this->objectManager    = $objectManagerProvider->get();
     $this->taskManager      = $taskManager;
     $this->filesystem       = $filesystem;
     parent::__construct();
 }

作者:andrewhowdenco    项目:m2onk8   
public function testCreate()
 {
     $this->objectManagerProvider->expects($this->once())->method('get')->willReturn($this->objectManager);
     $this->objectManager->expects($this->once())->method('get')->with('Magento\\Theme\\Model\\Theme\\ThemeDependencyChecker');
     $this->themeDependencyCheckerFactory = new ThemeDependencyCheckerFactory($this->objectManagerProvider);
     $this->themeDependencyCheckerFactory->create();
 }


问题


面经


文章

微信
公众号

扫码关注公众号