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('validator')->willReturn(false); $pool = new ValidatorPool($tMap); $pool->get('validator'); }
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' => 'Magento\\Payment\\Gateway\\Validator\\ValidatorInterface'])->willReturn($tMap); $tMap->expects(static::once())->method('offsetExists')->with('validator')->willReturn(false); $pool = new ValidatorPool([], $tMapFactory); $pool->get('validator'); }