Inheritance: implements Payum\Core\Action\ActionInterface, implements Payum\Core\ApiAwareInterface, implements Payum\Core\GatewayAwareInterface, use trait Payum\Core\ApiAwareTrait, use trait Payum\Core\GatewayAwareTrait
Beispiel #1
0
 /**
  * @test
  */
 public function shouldCallApiDoVoidMethodAndUpdateModelFromResponseOnSuccess()
 {
     $apiMock = $this->createApiMock();
     $apiMock->expects($this->once())->method('DoVoid')->will($this->returnCallback(function () {
         return array('AUTHORIZATIONID' => 'theTransactionId', 'MSGSUBID' => 'aMessageId');
     }));
     $action = new DoVoidAction();
     $action->setApi($apiMock);
     $request = new DoVoid(array('AUTHORIZATIONID' => 'theTransactionId'));
     $action->execute($request);
     $model = $request->getModel();
     $this->assertArrayHasKey('AUTHORIZATIONID', $model);
     $this->assertEquals('theTransactionId', $model['AUTHORIZATIONID']);
     $this->assertArrayHasKey('MSGSUBID', $model);
     $this->assertEquals('aMessageId', $model['MSGSUBID']);
 }