Exemplo n.º 1
0
 /**
  * Constructor
  *
  * @param Filesystem $filesystem
  * @param SetupLoggerFactory $setupLoggerFactory
  * @param string $statusFilePath
  * @param string $logFilePath
  * @param string $updateInProgressFlagFilePath
  * @param string $updateErrorFlagFilePath
  */
 public function __construct(Filesystem $filesystem, SetupLoggerFactory $setupLoggerFactory, $statusFilePath = null, $logFilePath = null, $updateInProgressFlagFilePath = null, $updateErrorFlagFilePath = null)
 {
     $this->varReaderWriter = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
     $this->statusFilePath = $statusFilePath ? $statusFilePath : '.update_status.txt';
     $this->logFilePath = $logFilePath ? $logFilePath : DirectoryList::LOG . '/update.log';
     $this->updateInProgressFlagFilePath = $updateInProgressFlagFilePath ? $updateInProgressFlagFilePath : '.update_in_progress.flag';
     $this->updateErrorFlagFilePath = $updateErrorFlagFilePath ? $updateErrorFlagFilePath : '.update_error.flag';
     $this->logger = $setupLoggerFactory->create('setup-cron');
 }
Exemplo n.º 2
0
 public function setUp()
 {
     $this->filesystem = $this->getMock('Magento\\Framework\\Filesystem', [], [], '', false);
     $this->varReaderWriter = $this->getMockForAbstractClass('Magento\\Framework\\Filesystem\\Directory\\WriteInterface', [], '', false);
     $this->filesystem->expects($this->once())->method('getDirectoryWrite')->will($this->returnValue($this->varReaderWriter));
     $this->logger = $this->getMockForAbstractClass('\\Psr\\Log\\LoggerInterface', [], '', false);
     $this->setupLoggerFactory = $this->getMock('\\Magento\\Setup\\Model\\Cron\\SetupLoggerFactory', [], [], '', false);
     $this->setupLoggerFactory->expects($this->once())->method('create')->with('setup-cron')->willReturn($this->logger);
     $this->status = new Status($this->filesystem, $this->setupLoggerFactory);
 }