15 $this->expectException(
'LogicException');
16 $tMapFactory = $this->getMockBuilder(\
Magento\Framework\ObjectManager\TMapFactory::class)
17 ->disableOriginalConstructor()
18 ->setMethods([
'create'])
21 $tMapFactory->expects(static::never())
28 $defaultHandler = $this->getMockBuilder(\
Magento\Payment\Gateway\
Config\ValueHandlerInterface::class)
29 ->disableOriginalConstructor()
30 ->getMockForAbstractClass();
31 $someValueHandler = $this->getMockBuilder(\
Magento\Payment\Gateway\
Config\ValueHandlerInterface::class)
32 ->disableOriginalConstructor()
33 ->getMockForAbstractClass();
34 $tMapFactory = $this->getMockBuilder(\
Magento\Framework\ObjectManager\TMapFactory::class)
35 ->disableOriginalConstructor()
36 ->setMethods([
'create'])
38 $tMap = $this->getMockBuilder(\
Magento\Framework\ObjectManager\TMap::class)
39 ->disableOriginalConstructor()
42 $tMapFactory->expects(static::once())
49 'some_value' => \
Magento\Payment\Gateway\
Config\ValueHandlerInterface::class
51 'type' => ValueHandlerInterface::class
55 $tMap->expects(static::exactly(3))
56 ->method(
'offsetExists')
63 $tMap->expects(static::exactly(3))
68 [
'some_value', $someValueHandler]
76 'some_value' => \
Magento\Payment\Gateway\
Config\ValueHandlerInterface::class
79 static::assertSame($someValueHandler, $pool->get(
'some_value'));
81 static::assertSame($defaultHandler, $pool->get(
'no_custom_logic_required'));
testConstructorException()