dolibarr.bankimport/vendor/nemiah/php-fints/lib/Tests/Fhp/BaseActionVopSerializationTest.php
data 8b64fd24d3 feat: php-fints 4.0 Update + HKEKA/HKKAA Segmente (WIP)
- php-fints Bibliothek von 3.7.0 auf 4.0.0 aktualisiert
- Parser-Fix: Ignoriert zusätzliche Bank-Felder statt Exception
- HKEKA Segmente implementiert (HIEKASv5, HKEKAv5, HIEKAv5)
- HKKAA Segmente implementiert (HIKAASv1, HKKAAv1)
- GetStatementFromArchive und GetElectronicStatement Actions

HINWEIS: HKKAA/HKEKA funktionieren noch nicht mit VR Bank
(Fehler "unerwarteter Aufbau wrt DE 2" - Kontoverbindungsformat)
Normale Funktionalität (Transaktionsimport) ist nicht betroffen.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-05 15:47:27 +01:00

58 lines
2.5 KiB
PHP

<?php
namespace Fhp;
use Tests\Fhp\Integration\Atruvia\SendTransferVoPTest;
class BaseActionVopSerializationTest extends SendTransferVoPTest
{
/**
* @throws \Throwable
*/
public function testSerializesPollingInfo()
{
// We piggy-back on the Atruvia integration test to provide an action that has some reasonable data inside and
// has already been executed so that polling is now required.
$this->initDialog();
$originalAction = $this->createAction();
$this->expectMessage(static::SEND_TRANSFER_REQUEST, mb_convert_encoding(static::SEND_TRANSFER_RESPONSE_POLLING_NEEDED, 'ISO-8859-1', 'UTF-8'));
$this->fints->execute($originalAction);
// Sanity-check that the polling is now expected.
$this->assertNotNull($originalAction->getPollingInfo());
// Do a serialization roundtrip.
$serializedAction = serialize($originalAction);
$unserializedAction = unserialize($serializedAction);
// Verify that the polling info is still the same.
$this->assertEquals($originalAction->getPollingInfo(), $unserializedAction->getPollingInfo());
}
/**
* @throws \Throwable
*/
public function testSerializesVopConfirmationRequest()
{
// We piggy-back on the Atruvia integration test to provide an action that has some reasonable data inside and
// has already been executed so that polling is now required.
$this->initDialog();
$originalAction = $this->createAction();
$this->expectMessage(static::SEND_TRANSFER_REQUEST, mb_convert_encoding(static::SEND_TRANSFER_RESPONSE_POLLING_NEEDED, 'ISO-8859-1', 'UTF-8'));
$response = static::buildVopReportResponse(static::VOP_REPORT_PARTIAL_MATCH_RESPONSE, static::VOP_REPORT_PARTIAL_MATCH_XML_PAYLOAD);
$this->expectMessage(static::POLL_VOP_REQUEST, $response);
$this->fints->execute($originalAction);
$this->assertTrue($originalAction->needsPollingWait());
$this->fints->pollAction($originalAction);
// Sanity-check that the VOP confirmation is now expected.
$this->assertNotNull($originalAction->getVopConfirmationRequest());
// Do a serialization roundtrip.
$serializedAction = serialize($originalAction);
$unserializedAction = unserialize($serializedAction);
// Verify that the polling info is still the same.
$this->assertEquals($originalAction->getVopConfirmationRequest(), $unserializedAction->getVopConfirmationRequest());
}
}