Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigTest.php
Go to the documentation of this file.
1 <?php
7 
11 class ConfigTest extends \PHPUnit\Framework\TestCase
12 {
16  protected $_configData;
17 
21  protected $_config;
22 
26  protected function setUp()
27  {
28  $this->_configData = $this->getMockBuilder(
29  \Magento\Cron\Model\Config\Data::class
30  )->disableOriginalConstructor()->getMock();
31  $this->_config = new \Magento\Cron\Model\Config($this->_configData);
32  }
33 
37  public function testGetJobs()
38  {
39  $jobList = [
40  'jobname1' => ['instance' => 'TestInstance', 'method' => 'testMethod', 'schedule' => '* * * * *'],
41  ];
42  $this->_configData->expects($this->once())->method('getJobs')->will($this->returnValue($jobList));
43  $result = $this->_config->getJobs();
44  $this->assertEquals($jobList, $result);
45  }
46 }