/**
* @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']);
}