/** * Runs script * * @return $this */ public function run() { if ($this->_showHelp()) { return $this; } if ($this->getArg('clean')) { $output = $this->_commandFactory->createCleanCommand($this->getArg('days'))->execute(); } elseif ($this->getArg('status')) { $output = $this->_commandFactory->createStatusCommand()->execute(); } else { $output = $this->getUsageHelp(); } echo $output; return $this; }
public function testCreateCleanCommand() { $this->_objectManagerMock->expects($this->once())->method('create')->with('Magento\\Log\\Model\\Shell\\Command\\Clean', ['days' => 1])->will($this->returnValue($this->getMock('Magento\\Log\\Model\\Shell\\Command\\Clean', [], [], '', false))); $this->isInstanceOf('Magento\\Log\\Model\\Shell\\CommandInterface', $this->_model->createCleanCommand(1)); }