52 $this->config = $this->getMockBuilder(\
Magento\NewRelicReporting\Model\Config::class)
53 ->disableOriginalConstructor()
54 ->setMethods([
'isNewRelicEnabled'])
56 $this->collectMock = $this->getMockBuilder(\
Magento\NewRelicReporting\Model\Module\Collect::class)
57 ->disableOriginalConstructor()
58 ->setMethods([
'getModuleData'])
60 $this->systemFactoryMock = $this->getMockBuilder(\
Magento\NewRelicReporting\Model\SystemFactory::class)
61 ->disableOriginalConstructor()
62 ->setMethods([
'create'])
64 $this->systemModelMock = $this->getMockBuilder(\
Magento\NewRelicReporting\Model\System::class)
65 ->disableOriginalConstructor()
67 $this->jsonEncoderMock = $this->getMockBuilder(\
Magento\Framework\Json\EncoderInterface::class)
70 $this->systemFactoryMock->expects($this->any())
72 ->willReturn($this->systemModelMock);
74 $this->jsonEncoderMock->expects($this->any())
76 ->willReturn(
'json_string');
81 $this->systemFactoryMock,
82 $this->jsonEncoderMock
93 $this->config->expects($this->once())
94 ->method(
'isNewRelicEnabled')
99 $this->model->report()
110 $this->config->expects($this->once())
111 ->method(
'isNewRelicEnabled')
113 $this->collectMock->expects($this->once())
114 ->method(
'getModuleData')
117 'uninstalled' =>
'1',
121 [
'name' =>
'name',
'setup_version' =>
'2.0.0',
'type' =>
'enabled'],
122 [
'name' =>
'name',
'setup_version' =>
'2.0.0',
'type' =>
'disabled'],
123 [
'name' =>
'name',
'setup_version' =>
'2.0.0',
'type' =>
'installed'],
124 [
'name' =>
'name',
'setup_version' =>
'2.0.0',
'type' =>
'uninstalled'],
127 $this->systemModelMock->expects($this->any())->method(
'setData')->willReturnSelf();
128 $this->systemModelMock->expects($this->any())->method(
'save')->willReturnSelf();
132 $this->model->report()
testReportModulesInfoModuleDisabledFromConfig()
testReportReportModulesInfo()