15 $commandI = $this->getMockBuilder(\
Magento\Payment\Gateway\CommandInterface::class)
16 ->getMockForAbstractClass();
17 $tMapFactory = $this->getMockBuilder(\
Magento\Framework\ObjectManager\TMapFactory::class)
18 ->disableOriginalConstructor()
19 ->setMethods([
'create'])
21 $tMap = $this->getMockBuilder(\
Magento\Framework\ObjectManager\TMap::class)
22 ->disableOriginalConstructor()
25 $tMapFactory->expects(static::once())
29 'array' => [\
Magento\Payment\Gateway\CommandInterface::class],
30 'type' => CommandInterface::class
34 $tMap->expects(static::once())
35 ->method(
'offsetExists')
38 $tMap->expects(static::once())
41 ->willReturn($commandI);
43 $pool =
new CommandPool($tMapFactory, [\
Magento\Payment\Gateway\CommandInterface::class]);
45 static::assertSame($commandI, $pool->get(
'command'));
50 $this->expectException(\
Magento\Framework\Exception\NotFoundException::class);
52 $tMapFactory = $this->getMockBuilder(\
Magento\Framework\ObjectManager\TMapFactory::class)
53 ->disableOriginalConstructor()
54 ->setMethods([
'create'])
56 $tMap = $this->getMockBuilder(\
Magento\Framework\ObjectManager\TMap::class)
57 ->disableOriginalConstructor()
60 $tMapFactory->expects(static::once())
65 'type' => CommandInterface::class
69 $tMap->expects(static::once())
70 ->method(
'offsetExists')
75 $pool->get(
'command');