13 class CronTest extends \PHPUnit\Framework\TestCase
42 $this->configMock = $this->getMockBuilder(\
Magento\NewRelicReporting\Model\Config::class)
43 ->setMethods([
'isCronEnabled'])
44 ->disableOriginalConstructor()
47 $this->reportModulesInfoMock = $this->getMockBuilder(
48 \
Magento\NewRelicReporting\Model\
Cron\ReportModulesInfo::class
49 )->disableOriginalConstructor()
52 $this->reportCountsMock = $this->getMockBuilder(\
Magento\NewRelicReporting\Model\
Cron\ReportCounts::class)
53 ->disableOriginalConstructor()
56 $this->reportNewRelicCronMock = $this->getMockBuilder(
57 \
Magento\NewRelicReporting\Model\
Cron\ReportNewRelicCron::class
58 )->disableOriginalConstructor()
61 $this->model =
new Cron(
63 $this->reportModulesInfoMock,
64 $this->reportCountsMock,
65 $this->reportNewRelicCronMock
76 $this->configMock->expects($this->once())
77 ->method(
'isCronEnabled')
82 $this->model->runCron()
93 $this->configMock->expects($this->once())
94 ->method(
'isCronEnabled')
97 $this->reportModulesInfoMock->expects($this->once())
100 $this->reportCountsMock->expects($this->once())
103 $this->reportNewRelicCronMock->expects($this->once())
109 $this->model->runCron()
testRunCronCronEnabledFromConfig()
testRunCronCronDisabledFromConfig()