public function testCreateFilesystem() { $testPath = 'test/path/'; /** * @var \Magento\Framework\App\Filesystem\DirectoryList| * \PHPUnit_Framework_MockObject_MockObject $directoryList */ $directoryList = $this->getMockBuilder('Magento\\Framework\\App\\Filesystem\\DirectoryList')->disableOriginalConstructor()->getMock(); $directoryList->expects($this->any())->method('getPath')->willReturn($testPath); $filesystem = $this->listener->createFilesystem($directoryList); // Verifies the filesystem was created with the directory list passed in $this->assertEquals($testPath, $filesystem->getDirectoryRead('app')->getAbsolutePath()); }
/** * {@inheritdoc} */ public function getConfig() { $result = array_merge(include __DIR__ . '/config/module.config.php', include __DIR__ . '/config/router.config.php', include __DIR__ . '/config/di.config.php', include __DIR__ . '/config/states.config.php', include __DIR__ . '/config/languages.config.php'); $result = InitParamListener::attachToConsoleRoutes($result); return $result; }
/** * Shows necessary information for installing Magento * * @return string * @throws \InvalidArgumentException */ public function helpAction() { $type = $this->getRequest()->getParam('type'); if ($type === false) { $usageInfo = $this->formatConsoleFullUsageInfo(array_merge(self::getConsoleUsage(), InitParamListener::getConsoleUsage())); return $usageInfo; } switch ($type) { case UserConfig::KEY_LANGUAGE: return $this->arrayToString($this->options->getLocaleList()); case UserConfig::KEY_CURRENCY: return $this->arrayToString($this->options->getCurrencyList()); case UserConfig::KEY_TIMEZONE: return $this->arrayToString($this->options->getTimezoneList()); case self::HELP_LIST_OF_MODULES: return $this->getModuleListMsg(); default: $usages = self::getCommandUsage(); if (isset($usages[$type])) { if ($usages[$type]) { $formatted = $this->formatCliUsage($usages[$type]); return "\nAvailable parameters:\n{$formatted}\n"; } return "\nThis command has no parameters.\n"; } throw new \InvalidArgumentException("Unknown type: {$type}"); } }