@@ -105,6 +105,48 @@ protected function setUp()
105
105
);
106
106
}
107
107
108
+ public function testFetchTransactionInfo ()
109
+ {
110
+ $ transactionId = 10555 ;
111
+ $ transactionInfo = ['test_key ' => 'test_value ' ];
112
+
113
+ $ valueHandler = $ this ->getMockForAbstractClass (ValueHandlerInterface::class);
114
+ $ command = $ this ->getMockForAbstractClass (CommandInterface::class);
115
+
116
+ /** @var InfoInterface|MockObject $paymentInfo */
117
+ $ paymentInfo = $ this ->getMockForAbstractClass (InfoInterface::class);
118
+ $ paymentDO = $ this ->getMockForAbstractClass (PaymentDataObjectInterface::class);
119
+
120
+ $ this ->valueHandlerPool ->expects (static ::once ())
121
+ ->method ('get ' )
122
+ ->with ('can_fetch_transaction_information ' )
123
+ ->willReturn ($ valueHandler );
124
+ $ valueHandler ->expects (static ::once ())
125
+ ->method ('handle ' )
126
+ ->with (['field ' => 'can_fetch_transaction_information ' ])
127
+ ->willReturn (true );
128
+
129
+ $ this ->paymentDataObjectFactory ->expects (static ::once ())
130
+ ->method ('create ' )
131
+ ->with ($ paymentInfo )
132
+ ->willReturn ($ paymentDO );
133
+
134
+ $ this ->commandPool ->expects (static ::once ())
135
+ ->method ('get ' )
136
+ ->with ('fetch_transaction_information ' )
137
+ ->willReturn ($ command );
138
+ $ command ->expects (static ::once ())
139
+ ->method ('execute ' )
140
+ ->with (['transactionId ' => $ transactionId , 'payment ' => $ paymentDO ])
141
+ ->willReturn ($ transactionInfo );
142
+
143
+ $ this ->assertEquals (
144
+ $ transactionInfo ,
145
+ $ this ->adapter ->fetchTransactionInfo ($ paymentInfo , $ transactionId )
146
+ );
147
+
148
+ }
149
+
108
150
/**
109
151
* @covers \Magento\Payment\Model\Method\Adapter::isAvailable
110
152
*/
0 commit comments