From e8faab805eb67a883b78c8143d2ff7e3ee077439 Mon Sep 17 00:00:00 2001 From: Simon Schaufelberger Date: Wed, 18 Feb 2026 19:53:18 +0100 Subject: [PATCH] Move tests into root folder and exclude them from packaging --- .gitattributes | 5 +++++ {lib/Tests/Fhp => Tests}/CLILogger.php | 6 ++++-- {lib/Tests/Fhp => Tests}/FinTsPeer.php | 2 +- .../Fhp => Tests/Unit}/Action/SendSEPATransferTest.php | 4 ++-- .../Fhp => Tests/Unit}/BaseActionTanSerializationTest.php | 4 ++-- .../Fhp => Tests/Unit}/BaseActionVopSerializationTest.php | 4 ++-- {lib/Tests/Fhp => Tests/Unit}/FinTsTestCase.php | 5 +++-- .../Integration/Atruvia/AtruviaIntegrationTestBase.php | 4 ++-- .../Unit}/Integration/Atruvia/SendTransferVoPTest.php | 2 +- .../Integration/Consors/ConsorsIntegrationTestBase.php | 6 +++--- .../Fhp => Tests/Unit}/Integration/Consors/GetBPDTest.php | 4 ++-- .../Unit}/Integration/Consors/GetSEPAAccountsTest.php | 2 +- .../Integration/Consors/GetStatementOfAccountTest.php | 2 +- .../Unit}/Integration/Consors/InitEndDialogTest.php | 2 +- .../Unit}/Integration/DKB/DKBIntegrationTestBase.php | 4 ++-- .../Fhp => Tests/Unit}/Integration/DKB/GetBalanceTest.php | 2 +- .../Unit}/Integration/DKB/GetSEPAAccountsTest.php | 2 +- .../Unit}/Integration/DKB/GetStatementOfAccountTest.php | 4 ++-- .../Unit}/Integration/DKB/InitEndDialogTest.php | 2 +- .../Unit}/Integration/DKB/SendSEPATransferTest.php | 4 ++-- .../Unit}/Integration/GLS/GLSIntegrationTestBase.php | 4 ++-- .../Integration/GLS/GetStatementOfAccountXMLTest.php | 4 ++-- .../Unit}/Integration/GLS/InitEndDialogTest.php | 2 +- .../Unit}/Integration/IngDiba/GetSEPAAccountsTest.php | 2 +- .../Integration/IngDiba/GetStatementOfAccountTest.php | 2 +- .../Integration/IngDiba/IngDibaIntegrationTestBase.php | 4 ++-- .../Integration/IngDiba/InitDialogWithBlockedPinTest.php | 2 +- .../Unit}/Integration/IngDiba/InitEndDialogTest.php | 2 +- .../Unit}/Integration/InitializationErrorTest.php | 4 ++-- .../Unit}/Integration/KSK/Biberach/GetBPDTest.php | 4 ++-- .../KSK/Biberach/KskBiberachIntegrationTestBase.php | 4 ++-- .../Integration/KSK/InitDialogWithBlockedPinTest.php | 2 +- .../Unit}/Integration/KSK/KSKIntegrationTestBase.php | 4 ++-- .../Unit}/Integration/Postbank/GetSEPAAccountsTest.php | 2 +- .../Integration/Postbank/InitDialogWithBlockedPinTest.php | 2 +- .../Unit}/Integration/Postbank/InitEndDialogTest.php | 2 +- .../Integration/Postbank/PostbankIntegrationTestBase.php | 4 ++-- .../Model/FlickerTan/TanRequestChallengeFlickerTest.php | 2 +- .../Fhp => Tests/Unit}/Options/SanitizingLoggerTest.php | 2 +- .../Unit}/Protocol/DialogInitializationTest.php | 7 ++++--- .../Unit}/Protocol/DialogInitializationTestModel.php | 2 +- .../Fhp => Tests/Unit}/Protocol/ServerExceptionTest.php | 5 +++-- .../Fhp => Tests/Unit}/Segment/AnonymousSegmentTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/Common/TspTest.php | 2 +- .../Unit}/Segment/FindRueckmeldungTraitTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/HICAZTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/HISALTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/HITABTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/HITANSTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/HIUPATest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/HIUPDTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/HIVPPSTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/HKCCSTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/HKSPATest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/HKVPPTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/HNVSDTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Segment/HNVSKTest.php | 2 +- .../Fhp => Tests/Unit}/Segment/SegmentComparator.php | 2 +- .../Fhp => Tests/Unit}/Segment/UpdSerializationTest.php | 2 +- {lib/Tests/Fhp => Tests}/Unit/SendSEPADirectDebitTest.php | 5 ++--- {lib/Tests/Fhp => Tests/Unit}/Syntax/BinTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Syntax/ParserTest.php | 2 +- {lib/Tests/Fhp => Tests/Unit}/Syntax/SerializerTest.php | 2 +- {lib/Tests => Tests}/phpunit_bootstrap.php | 2 +- {lib/Tests => Tests}/resources/pain.008.002.02.xml | 0 composer.json | 8 ++++++-- phpunit.xml.dist | 6 +++--- 67 files changed, 106 insertions(+), 93 deletions(-) create mode 100644 .gitattributes rename {lib/Tests/Fhp => Tests}/CLILogger.php (79%) rename {lib/Tests/Fhp => Tests}/FinTsPeer.php (97%) rename {lib/Tests/Fhp => Tests/Unit}/Action/SendSEPATransferTest.php (94%) rename {lib/Tests/Fhp => Tests/Unit}/BaseActionTanSerializationTest.php (91%) rename {lib/Tests/Fhp => Tests/Unit}/BaseActionVopSerializationTest.php (96%) rename {lib/Tests/Fhp => Tests/Unit}/FinTsTestCase.php (97%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/Atruvia/AtruviaIntegrationTestBase.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/Atruvia/SendTransferVoPTest.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/Consors/ConsorsIntegrationTestBase.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/Consors/GetBPDTest.php (90%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/Consors/GetSEPAAccountsTest.php (96%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/Consors/GetStatementOfAccountTest.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/Consors/InitEndDialogTest.php (98%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/DKB/DKBIntegrationTestBase.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/DKB/GetBalanceTest.php (97%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/DKB/GetSEPAAccountsTest.php (96%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/DKB/GetStatementOfAccountTest.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/DKB/InitEndDialogTest.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/DKB/SendSEPATransferTest.php (98%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/GLS/GLSIntegrationTestBase.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/GLS/GetStatementOfAccountXMLTest.php (98%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/GLS/InitEndDialogTest.php (92%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/IngDiba/GetSEPAAccountsTest.php (97%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/IngDiba/GetStatementOfAccountTest.php (97%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/IngDiba/IngDibaIntegrationTestBase.php (98%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/IngDiba/InitDialogWithBlockedPinTest.php (95%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/IngDiba/InitEndDialogTest.php (89%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/InitializationErrorTest.php (97%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/KSK/Biberach/GetBPDTest.php (89%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/KSK/Biberach/KskBiberachIntegrationTestBase.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/KSK/InitDialogWithBlockedPinTest.php (97%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/KSK/KSKIntegrationTestBase.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/Postbank/GetSEPAAccountsTest.php (94%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/Postbank/InitDialogWithBlockedPinTest.php (97%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/Postbank/InitEndDialogTest.php (89%) rename {lib/Tests/Fhp => Tests/Unit}/Integration/Postbank/PostbankIntegrationTestBase.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Model/FlickerTan/TanRequestChallengeFlickerTest.php (97%) rename {lib/Tests/Fhp => Tests/Unit}/Options/SanitizingLoggerTest.php (97%) rename {lib/Tests/Fhp => Tests/Unit}/Protocol/DialogInitializationTest.php (83%) rename {lib/Tests/Fhp => Tests/Unit}/Protocol/DialogInitializationTestModel.php (94%) rename {lib/Tests/Fhp => Tests/Unit}/Protocol/ServerExceptionTest.php (95%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/AnonymousSegmentTest.php (97%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/Common/TspTest.php (93%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/FindRueckmeldungTraitTest.php (98%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/HICAZTest.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/HISALTest.php (96%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/HITABTest.php (97%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/HITANSTest.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/HIUPATest.php (92%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/HIUPDTest.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/HIVPPSTest.php (98%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/HKCCSTest.php (95%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/HKSPATest.php (92%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/HKVPPTest.php (96%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/HNVSDTest.php (98%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/HNVSKTest.php (98%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/SegmentComparator.php (95%) rename {lib/Tests/Fhp => Tests/Unit}/Segment/UpdSerializationTest.php (98%) rename {lib/Tests/Fhp => Tests}/Unit/SendSEPADirectDebitTest.php (71%) rename {lib/Tests/Fhp => Tests/Unit}/Syntax/BinTest.php (94%) rename {lib/Tests/Fhp => Tests/Unit}/Syntax/ParserTest.php (99%) rename {lib/Tests/Fhp => Tests/Unit}/Syntax/SerializerTest.php (98%) rename {lib/Tests => Tests}/phpunit_bootstrap.php (70%) rename {lib/Tests => Tests}/resources/pain.008.002.02.xml (100%) diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..d973a01c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +/.* export-ignore +/Tests export-ignore +/DEVELOPER-GUIDE.md export-ignore +/phplint.sh export-ignore +/phpunit.xml.dist export-ignore diff --git a/lib/Tests/Fhp/CLILogger.php b/Tests/CLILogger.php similarity index 79% rename from lib/Tests/Fhp/CLILogger.php rename to Tests/CLILogger.php index 655504f8..96a1526b 100644 --- a/lib/Tests/Fhp/CLILogger.php +++ b/Tests/CLILogger.php @@ -1,12 +1,14 @@ assertNotEmpty($this->expectedMessages, "Expected no more requests, but got: $request"); - list($expectedRequest, $mockResponse) = array_shift($this->expectedMessages); + [$expectedRequest, $mockResponse] = array_shift($this->expectedMessages); // Check that the request matches the expectation. if (strlen($expectedRequest) > 0 && !str_starts_with($expectedRequest, 'HNHBK')) { diff --git a/lib/Tests/Fhp/Integration/Atruvia/AtruviaIntegrationTestBase.php b/Tests/Unit/Integration/Atruvia/AtruviaIntegrationTestBase.php similarity index 99% rename from lib/Tests/Fhp/Integration/Atruvia/AtruviaIntegrationTestBase.php rename to Tests/Unit/Integration/Atruvia/AtruviaIntegrationTestBase.php index efdd4555..d03e7479 100644 --- a/lib/Tests/Fhp/Integration/Atruvia/AtruviaIntegrationTestBase.php +++ b/Tests/Unit/Integration/Atruvia/AtruviaIntegrationTestBase.php @@ -1,9 +1,9 @@ register(new SegmentComparator()); diff --git a/lib/Tests/resources/pain.008.002.02.xml b/Tests/resources/pain.008.002.02.xml similarity index 100% rename from lib/Tests/resources/pain.008.002.02.xml rename to Tests/resources/pain.008.002.02.xml diff --git a/composer.json b/composer.json index 08e40202..ec8c9c4a 100644 --- a/composer.json +++ b/composer.json @@ -6,8 +6,12 @@ "license": "MIT", "autoload": { "psr-0": { - "Fhp": "lib/", - "Tests\\Fhp": "lib/" + "Fhp": "lib/" + } + }, + "autoload-dev": { + "psr-4": { + "Fhp\\Tests\\": "Tests/" } }, "require": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 82e780f0..2a08cf1b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,8 +8,8 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - bootstrap="./lib/Tests/phpunit_bootstrap.php" - xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> + bootstrap="./Tests/phpunit_bootstrap.php" + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"> ./lib/Fhp/ @@ -17,7 +17,7 @@ - ./lib/Tests/Fhp/ + Tests/Unit/