Ejemplo n.º 1
0
 /**
  * @param string $expectedInstance
  * @param string $loggerType
  * @param string $path
  * @dataProvider getLoggerDataProvider
  */
 public function testGetLogger($expectedInstance, $loggerType, $path)
 {
     $this->assertInstanceOf($expectedInstance, $this->_model->getLogger($loggerType, $path, $this->_fileManagerMock));
 }
Ejemplo n.º 2
0
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   Tools
 * @package    system_configuration
 * @copyright  Copyright (c) 2012 X.commerce, Inc. (http://www.magentocommerce.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
$rootDir = realpath(__DIR__ . '../../../..');
require __DIR__ . '/../../../app/autoload.php';
Magento_Autoload_IncludePath::addIncludePath(array($rootDir . '/lib', $rootDir . '/dev'));
$defaultReportFile = 'report.log';
try {
    $options = new Zend_Console_Getopt(array('mode|w' => "Application mode.  Preview mode is default. If set to 'write' - file system is updated", 'output|f-w' => "Report output type. Report is flushed to console by default." . "If set to 'file', report is written to file /log/report.log"));
    $writerFactory = new Tools_Migration_System_Writer_Factory();
    $fileManager = new Tools_Migration_System_FileManager(new Tools_Migration_System_FileReader(), $writerFactory->getWriter($options->getOption('mode')));
    $loggerFactory = new Tools_Migration_System_Configuration_Logger_Factory();
    $logger = $loggerFactory->getLogger($options->getOption('output'), $defaultReportFile, $fileManager);
    $generator = new Tools_Migration_System_Configuration_Generator(new Tools_Migration_System_Configuration_Formatter(), $fileManager, $logger);
    $fieldMapper = new Tools_Migration_System_Configuration_Mapper_Field();
    $groupMapper = new Tools_Migration_System_Configuration_Mapper_Group($fieldMapper);
    $sectionMapper = new Tools_Migration_System_Configuration_Mapper_Section($groupMapper);
    $tabMapper = new Tools_Migration_System_Configuration_Mapper_Tab();
    $mapper = new Tools_Migration_System_Configuration_Mapper($tabMapper, $sectionMapper);
    $parser = new Tools_Migration_System_Configuration_Parser();
    $reader = new Tools_Migration_System_Configuration_Reader($fileManager, $parser, $mapper);
    foreach ($reader->getConfiguration() as $file => $config) {
        $generator->createConfiguration($file, $config);
        $fileManager->remove($file);
    }
    $logger->report();
} catch (Zend_Console_Getopt_Exception $e) {