Skip to content

Commit b30ee2b

Browse files
authored
Merge pull request #518 from Philipp91/serialization-test
Add BaseActionTanSerializationTest
2 parents 7b11cda + 3a409ec commit b30ee2b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace Fhp;
4+
5+
use Tests\Fhp\Integration\DKB\SendSEPATransferTest as DKBSendSEPATransferTest;
6+
7+
class BaseActionTanSerializationTest extends DKBSendSEPATransferTest
8+
{
9+
/**
10+
* @throws \Throwable
11+
*/
12+
public function testSerializesTanRequest()
13+
{
14+
// We piggy-back on the DKB integration test to provide an action that has some reasonable data inside and that
15+
// has already been executed so that a TAN request is present.
16+
$this->initDialog();
17+
$this->expectMessage($this->getSendTransferRequest(), static::SEND_TRANSFER_RESPONSE);
18+
$originalAction = $this->runInitialRequest();
19+
20+
// Sanity-check that the TAN request is present.
21+
$this->assertNotNull($originalAction->getTanRequest());
22+
$this->assertNotNull($originalAction->getNeedTanForSegment());
23+
24+
// Do a serialization roundtrip.
25+
$serializedAction = serialize($originalAction);
26+
$unserializedAction = unserialize($serializedAction);
27+
28+
// Verify that the TAN request hasn't changed.
29+
$this->assertEquals($originalAction->getTanRequest(), $unserializedAction->getTanRequest());
30+
$this->assertEquals($originalAction->getNeedTanForSegment(), $unserializedAction->getNeedTanForSegment());
31+
}
32+
}

0 commit comments

Comments
 (0)