Пример #1
0
 public function testGetException()
 {
     $this->setExpectedException('Magento\\Framework\\Exception\\NotFoundException');
     $tMap = $this->getMockBuilder('Magento\\Framework\\ObjectManager\\TMap')->disableOriginalConstructor()->getMock();
     $tMap->expects(static::once())->method('offsetExists')->with('command')->willReturn(false);
     $pool = new CommandPool($tMap);
     $pool->get('command');
 }
Пример #2
0
 public function testGetException()
 {
     $this->setExpectedException('Magento\\Framework\\Exception\\NotFoundException');
     $tMapFactory = $this->getMockBuilder('Magento\\Framework\\ObjectManager\\TMapFactory')->disableOriginalConstructor()->setMethods(['create'])->getMock();
     $tMap = $this->getMockBuilder('Magento\\Framework\\ObjectManager\\TMap')->disableOriginalConstructor()->getMock();
     $tMapFactory->expects(static::once())->method('create')->with(['array' => [], 'type' => CommandInterface::class])->willReturn($tMap);
     $tMap->expects(static::once())->method('offsetExists')->with('command')->willReturn(false);
     $pool = new CommandPool($tMapFactory, []);
     $pool->get('command');
 }