<?php /** * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ $applicationBaseDir = (require_once __DIR__ . '/framework/bootstrap.php'); try { $totalStartTime = microtime(true); $shell = new Zend_Console_Getopt(['profile-s' => 'Profile configuration file']); \Magento\ToolkitFramework\Helper\Cli::setOpt($shell); $args = $shell->getOptions(); if (empty($args)) { echo $shell->getUsageMessage(); exit(0); } $config = \Magento\ToolkitFramework\Config::getInstance(); $config->loadConfig(\Magento\ToolkitFramework\Helper\Cli::getOption('profile')); $config->loadLabels(__DIR__ . '/framework/labels.xml'); $labels = $config->getLabels(); echo 'Generating profile with following params:' . PHP_EOL; foreach ($labels as $configKey => $label) { echo ' |- ' . $label . ': ' . $config->getValue($configKey) . PHP_EOL; } $files = \Magento\ToolkitFramework\FixtureSet::getInstance()->getFixtures(); $logWriter = new \Zend_Log_Writer_Stream('php://output'); $logWriter->setFormatter(new \Zend_Log_Formatter_Simple('%message%' . PHP_EOL)); $logger = new \Zend_Log($logWriter); $shell = new \Magento\Framework\Shell(new \Magento\Framework\Shell\CommandRenderer(), $logger); $application = new \Magento\ToolkitFramework\Application($applicationBaseDir, $shell); $application->bootstrap();
/** * Set up before test * * @return void */ public function setUp() { $this->_getOpt = $this->getMock('Zend_Console_Getopt', ['getOption'], [[]]); $this->_getOpt->expects($this->any())->method('getOption')->will($this->returnValueMap([[self::TEST_OPTION_NAME, self::TEST_OPTION_VALUE], ['xxx', null]])); \Magento\ToolkitFramework\Helper\Cli::setOpt($this->_getOpt); }