示例#1
0
 public function testPopQueuedJobEmptyAfter()
 {
     $this->reader->expects($this->once())->method('read')->willReturn('{"jobs": [{"name": "job A", "params" : []}]}');
     $job = $this->getMockForAbstractClass('Magento\\Setup\\Model\\Cron\\AbstractJob', [], '', false);
     $this->jobFactory->expects($this->once())->method('create')->with('job A', [])->willReturn($job);
     $this->writer->expects($this->once())->method('write')->with('');
     $this->assertEquals($job, $this->queue->popQueuedJob());
 }
示例#2
0
 public function testCacheDisable()
 {
     $valueMap = [['Magento\\Backend\\Console\\Command\\CacheDisableCommand', $this->getMock('Magento\\Backend\\Console\\Command\\CacheDisableCommand', [], [], '', false)]];
     $this->objectManager->expects($this->any())->method('get')->will($this->returnValueMap($valueMap));
     $this->assertInstanceOf('Magento\\Setup\\Model\\Cron\\JobSetCache', $this->jobFactory->create('setup:cache:disable', []));
 }
 public function testModuleEnable()
 {
     $valueMap = [['Magento\\Framework\\Module\\PackageInfoFactory', $this->getMock('Magento\\Framework\\Module\\PackageInfoFactory', [], [], '', false)]];
     $this->objectManager->expects($this->any())->method('get')->will($this->returnValueMap($valueMap));
     $this->assertInstanceOf('Magento\\Setup\\Model\\Cron\\AbstractJob', $this->jobFactory->create('setup:module:enable', []));
 }