浏览代码

SwissQR: drop unused dependencies' paths

Also rename the composer json to .disabled to avoid CI issues
Didier 'OdyX' Raboud 2 年之前
父节点
当前提交
b6a23fc54c
共有 100 个文件被更改,包括 0 次插入12135 次删除
  1. 0 0
      htdocs/includes/bacon/bacon-qr-code/composer.json.disabled
  2. 0 13
      htdocs/includes/bacon/bacon-qr-code/phpunit.xml.dist
  3. 0 222
      htdocs/includes/bacon/bacon-qr-code/test/Common/BitArrayTest.php
  4. 0 115
      htdocs/includes/bacon/bacon-qr-code/test/Common/BitMatrixTest.php
  5. 0 25
      htdocs/includes/bacon/bacon-qr-code/test/Common/BitUtilsTest.php
  6. 0 25
      htdocs/includes/bacon/bacon-qr-code/test/Common/ErrorCorrectionLevelTest.php
  7. 0 94
      htdocs/includes/bacon/bacon-qr-code/test/Common/FormatInformationTest.php
  8. 0 19
      htdocs/includes/bacon/bacon-qr-code/test/Common/ModeTest.php
  9. 0 96
      htdocs/includes/bacon/bacon-qr-code/test/Common/ReedSolomonCodecTest.php
  10. 0 78
      htdocs/includes/bacon/bacon-qr-code/test/Common/VersionTest.php
  11. 0 487
      htdocs/includes/bacon/bacon-qr-code/test/Encoder/EncoderTest.php
  12. 0 251
      htdocs/includes/bacon/bacon-qr-code/test/Encoder/MaskUtilTest.php
  13. 0 335
      htdocs/includes/bacon/bacon-qr-code/test/Encoder/MatrixUtilTest.php
  14. 0 72
      htdocs/includes/bacon/bacon-qr-code/test/Integration/ImagickRenderingTest.php
  15. 二进制
      htdocs/includes/bacon/bacon-qr-code/test/Integration/__snapshots__/files/ImagickRenderingTest__testGenericQrCode__1.png
  16. 二进制
      htdocs/includes/bacon/bacon-qr-code/test/Integration/__snapshots__/files/ImagickRenderingTest__testIssue79__1.png
  17. 0 0
      htdocs/includes/dasprid/enum/composer.json.disabled
  18. 0 17
      htdocs/includes/dasprid/enum/phpunit.xml.dist
  19. 0 121
      htdocs/includes/dasprid/enum/test/AbstractEnumTest.php
  20. 0 243
      htdocs/includes/dasprid/enum/test/EnumMapTest.php
  21. 0 31
      htdocs/includes/dasprid/enum/test/NullValueTest.php
  22. 0 73
      htdocs/includes/dasprid/enum/test/Planet.php
  23. 0 26
      htdocs/includes/dasprid/enum/test/WeekDay.php
  24. 0 0
      htdocs/includes/endroid/qr-code/composer.json.disabled
  25. 0 0
      htdocs/includes/kmukku/php-iso11649/composer.json.disabled
  26. 0 0
      htdocs/includes/sprain/swiss-qr-bill/composer.json.disabled
  27. 二进制
      htdocs/includes/sprain/swiss-qr-bill/docs/assets/example-payment-part.png
  28. 0 3552
      htdocs/includes/sprain/swiss-qr-bill/docs/specs/ig-qr-bill-en-v2.2.pdf
  29. 二进制
      htdocs/includes/sprain/swiss-qr-bill/docs/specs/qr-iid_qr-iban-en.pdf
  30. 0 54
      htdocs/includes/sprain/swiss-qr-bill/docs/specs/style-guide-en.pdf
  31. 0 31
      htdocs/includes/sprain/swiss-qr-bill/example/FpdfOutput/fpdf-example.php
  32. 0 21
      htdocs/includes/sprain/swiss-qr-bill/example/HtmlOutput/html-example.php
  33. 0 27
      htdocs/includes/sprain/swiss-qr-bill/example/TcPdfOutput/tcpdf-example.php
  34. 0 92
      htdocs/includes/sprain/swiss-qr-bill/example/example.php
  35. 0 61
      htdocs/includes/sprain/swiss-qr-bill/example/example_minimal.php
  36. 0 82
      htdocs/includes/sprain/swiss-qr-bill/example/example_scor.php
  37. 0 72
      htdocs/includes/sprain/swiss-qr-bill/example/example_zero_amount.php
  38. 0 17
      htdocs/includes/sprain/swiss-qr-bill/phpunit.xml.dist
  39. 0 157
      htdocs/includes/sprain/swiss-qr-bill/tests/Constraints/ValidCreditorInformationPaymentReferenceCombinationTest.php
  40. 0 71
      htdocs/includes/sprain/swiss-qr-bill/tests/Constraints/ValidCreditorReferenceTest.php
  41. 0 71
      htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/AdditionalInformationTest.php
  42. 0 35
      htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/AlternativeSchemeTest.php
  43. 0 317
      htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/CombinedAddressTest.php
  44. 0 113
      htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/CreditorInformationTest.php
  45. 0 125
      htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/HeaderTest.php
  46. 0 103
      htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/PaymentAmountInformationTest.php
  47. 0 127
      htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/PaymentReferenceTest.php
  48. 0 400
      htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/StructuredAddressTest.php
  49. 0 132
      htdocs/includes/sprain/swiss-qr-bill/tests/PaymentPart/Output/FpdfOutput/FpdfOutputTest.php
  50. 0 106
      htdocs/includes/sprain/swiss-qr-bill/tests/PaymentPart/Output/FpdfOutput/FpdiOutputTest.php
  51. 0 64
      htdocs/includes/sprain/swiss-qr-bill/tests/PaymentPart/Output/HtmlOutput/HtmlOutputTest.php
  52. 0 83
      htdocs/includes/sprain/swiss-qr-bill/tests/PaymentPart/Output/TcPdfOutput/FpdiOutputTest.php
  53. 0 82
      htdocs/includes/sprain/swiss-qr-bill/tests/PaymentPart/Output/TcPdfOutput/TcPdfOutputTest.php
  54. 0 48
      htdocs/includes/sprain/swiss-qr-bill/tests/PaymentPart/TranslationTest.php
  55. 0 247
      htdocs/includes/sprain/swiss-qr-bill/tests/QrBillTest.php
  56. 0 76
      htdocs/includes/sprain/swiss-qr-bill/tests/QrCode/QrCodeTest.php
  57. 0 134
      htdocs/includes/sprain/swiss-qr-bill/tests/Reference/QrPaymentReferenceGeneratorTest.php
  58. 0 69
      htdocs/includes/sprain/swiss-qr-bill/tests/Reference/RfCreditorReferenceGeneratorTest.php
  59. 0 74
      htdocs/includes/sprain/swiss-qr-bill/tests/String/StringModifierTest.php
  60. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-additional-information.pdf
  61. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-additional-information.print.pdf
  62. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-alternative-schemes.pdf
  63. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-alternative-schemes.print.pdf
  64. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-full-set.pdf
  65. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-full-set.print.pdf
  66. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-international-ultimate-debtor.pdf
  67. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-international-ultimate-debtor.print.pdf
  68. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-minimal-setup.pdf
  69. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-minimal-setup.print.pdf
  70. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-with-mediumlong-creditor-and-unknown-debtor.pdf
  71. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-with-mediumlong-creditor-and-unknown-debtor.print.pdf
  72. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-without-amount-and-long-addresses.pdf
  73. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-without-amount-and-long-addresses.print.pdf
  74. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-without-amount-but-debtor.pdf
  75. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-without-amount-but-debtor.print.pdf
  76. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-without-amount.pdf
  77. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-without-amount.print.pdf
  78. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-zero-amount.pdf
  79. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-zero-amount.print.pdf
  80. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-reference-non.pdf
  81. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-reference-non.print.pdf
  82. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-reference-scor.pdf
  83. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-reference-scor.print.pdf
  84. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-ultimate-debtor.pdf
  85. 二进制
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-ultimate-debtor.print.pdf
  86. 0 205
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-additional-information.svg.html
  87. 0 215
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-additional-information.svg.print.html
  88. 0 205
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-alternative-schemes.svg.html
  89. 0 215
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-alternative-schemes.svg.print.html
  90. 0 207
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-full-set.svg.html
  91. 0 217
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-full-set.svg.print.html
  92. 0 207
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-international-ultimate-debtor.svg.html
  93. 0 217
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-international-ultimate-debtor.svg.print.html
  94. 0 205
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-minimal-setup.svg.html
  95. 0 215
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-minimal-setup.svg.print.html
  96. 0 204
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-payment-information-with-mediumlong-creditor-and-unknown-debtor.svg.html
  97. 0 214
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-payment-information-with-mediumlong-creditor-and-unknown-debtor.svg.print.html
  98. 0 203
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-payment-information-without-amount-and-long-addresses.svg.html
  99. 0 213
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-payment-information-without-amount-and-long-addresses.svg.print.html
  100. 0 207
      htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-payment-information-without-amount-but-debtor.svg.html

+ 0 - 0
htdocs/includes/bacon/bacon-qr-code/composer.json → htdocs/includes/bacon/bacon-qr-code/composer.json.disabled


+ 0 - 13
htdocs/includes/bacon/bacon-qr-code/phpunit.xml.dist

@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
-  <coverage processUncoveredFiles="true">
-    <include>
-      <directory suffix=".php">src</directory>
-    </include>
-  </coverage>
-  <testsuites>
-    <testsuite name="BaconQrCode Tests">
-      <directory>./test</directory>
-    </testsuite>
-  </testsuites>
-</phpunit>

+ 0 - 222
htdocs/includes/bacon/bacon-qr-code/test/Common/BitArrayTest.php

@@ -1,222 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace BaconQrCodeTest\Common;
-
-use BaconQrCode\Common\BitArray;
-use PHPUnit\Framework\TestCase;
-use PHPUnit\Runner\Version as PHPUnitVersion;
-
-final class BitArrayTest extends TestCase
-{
-    private function getPhpUnitMajorVersion(): int
-    {
-        return (int) explode('.', PHPUnitVersion::id())[0];
-    }
-
-    public function testGetSet() : void
-    {
-        $array = new BitArray(33);
-
-        for ($i = 0; $i < 33; ++$i) {
-            $this->assertFalse($array->get($i));
-            $array->set($i);
-            $this->assertTrue($array->get($i));
-        }
-    }
-
-    public function testGetNextSet1() : void
-    {
-        $array = new BitArray(32);
-
-        for ($i = 0; $i < $array->getSize(); ++$i) {
-            if ($this->getPhpUnitMajorVersion() === 7) {
-                $this->assertEquals($i, 32, '', $array->getNextSet($i));
-            } else {
-                $this->assertEqualsWithDelta($i, 32, $array->getNextSet($i));
-            }
-        }
-
-        $array = new BitArray(33);
-
-        for ($i = 0; $i < $array->getSize(); ++$i) {
-            if ($this->getPhpUnitMajorVersion() === 7) {
-                $this->assertEquals($i, 33, '', $array->getNextSet($i));
-            } else {
-                $this->assertEqualsWithDelta($i, 33, $array->getNextSet($i));
-            }
-        }
-    }
-
-    public function testGetNextSet2() : void
-    {
-        $array = new BitArray(33);
-
-        for ($i = 0; $i < $array->getSize(); ++$i) {
-            if ($this->getPhpUnitMajorVersion() === 7) {
-                $this->assertEquals($i, $i <= 31 ? 31 : 33, '', $array->getNextSet($i));
-            } else {
-                $this->assertEqualsWithDelta($i, $i <= 31 ? 31 : 33, $array->getNextSet($i));
-            }
-        }
-
-        $array = new BitArray(33);
-
-        for ($i = 0; $i < $array->getSize(); ++$i) {
-            if ($this->getPhpUnitMajorVersion() === 7) {
-                $this->assertEquals($i, 32, '', $array->getNextSet($i));
-            } else {
-                $this->assertEqualsWithDelta($i, 32, $array->getNextSet($i));
-            }
-        }
-    }
-
-    public function testGetNextSet3() : void
-    {
-        $array = new BitArray(63);
-        $array->set(31);
-        $array->set(32);
-
-        for ($i = 0; $i < $array->getSize(); ++$i) {
-            if ($i <= 31) {
-                $expected = 31;
-            } elseif ($i <= 32) {
-                $expected = 32;
-            } else {
-                $expected = 63;
-            }
-
-            if ($this->getPhpUnitMajorVersion() === 7) {
-                $this->assertEquals($i, $expected, '', $array->getNextSet($i));
-            } else {
-                $this->assertEqualsWithDelta($i, $expected, $array->getNextSet($i));
-            }
-        }
-    }
-
-    public function testGetNextSet4() : void
-    {
-        $array = new BitArray(63);
-        $array->set(33);
-        $array->set(40);
-
-        for ($i = 0; $i < $array->getSize(); ++$i) {
-            if ($i <= 33) {
-                $expected = 33;
-            } elseif ($i <= 40) {
-                $expected = 40;
-            } else {
-                $expected = 63;
-            }
-
-            if ($this->getPhpUnitMajorVersion() === 7) {
-                $this->assertEquals($i, $expected, '', $array->getNextSet($i));
-            } else {
-                $this->assertEqualsWithDelta($i, $expected, $array->getNextSet($i));
-            }
-        }
-    }
-
-    public function testGetNextSet5() : void
-    {
-        mt_srand(0xdeadbeef, MT_RAND_PHP);
-
-        for ($i = 0; $i < 10; ++$i) {
-            $array = new BitArray(mt_rand(1, 100));
-            $numSet = mt_rand(0, 19);
-
-            for ($j = 0; $j < $numSet; ++$j) {
-                $array->set(mt_rand(0, $array->getSize() - 1));
-            }
-
-            $numQueries = mt_rand(0, 19);
-
-            for ($j = 0; $j < $numQueries; ++$j) {
-                $query = mt_rand(0, $array->getSize() - 1);
-                $expected = $query;
-
-                while ($expected < $array->getSize() && ! $array->get($expected)) {
-                    ++$expected;
-                }
-
-                $actual = $array->getNextSet($query);
-
-                if ($actual !== $expected) {
-                    $array->getNextSet($query);
-                }
-
-                $this->assertEquals($expected, $actual);
-            }
-        }
-    }
-
-    public function testSetBulk() : void
-    {
-        $array = new BitArray(64);
-        $array->setBulk(32, 0xFFFF0000);
-
-        for ($i = 0; $i < 48; ++$i) {
-            $this->assertFalse($array->get($i));
-        }
-
-        for ($i = 48; $i < 64; ++$i) {
-            $this->assertTrue($array->get($i));
-        }
-    }
-
-    public function testClear() : void
-    {
-        $array = new BitArray(32);
-
-        for ($i = 0; $i < 32; ++$i) {
-            $array->set($i);
-        }
-
-        $array->clear();
-
-        for ($i = 0; $i < 32; ++$i) {
-            $this->assertFalse($array->get($i));
-        }
-    }
-
-    public function testGetArray() : void
-    {
-        $array = new BitArray(64);
-        $array->set(0);
-        $array->set(63);
-
-        $ints = $array->getBitArray();
-
-        $this->assertSame(1, $ints[0]);
-        $this->assertSame(0x80000000, $ints[1]);
-    }
-
-    public function testIsRange() : void
-    {
-        $array = new BitArray(64);
-        $this->assertTrue($array->isRange(0, 64, false));
-        $this->assertFalse($array->isRange(0, 64, true));
-
-        $array->set(32);
-        $this->assertTrue($array->isRange(32, 33, true));
-
-        $array->set(31);
-        $this->assertTrue($array->isRange(31, 33, true));
-
-        $array->set(34);
-        $this->assertFalse($array->isRange(31, 35, true));
-
-        for ($i = 0; $i < 31; ++$i) {
-            $array->set($i);
-        }
-
-        $this->assertTrue($array->isRange(0, 33, true));
-
-        for ($i = 33; $i < 64; ++$i) {
-            $array->set($i);
-        }
-
-        $this->assertTrue($array->isRange(0, 64, true));
-        $this->assertFalse($array->isRange(0, 64, false));
-    }
-}

+ 0 - 115
htdocs/includes/bacon/bacon-qr-code/test/Common/BitMatrixTest.php

@@ -1,115 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace BaconQrCodeTest\Common;
-
-use BaconQrCode\Common\BitArray;
-use BaconQrCode\Common\BitMatrix;
-use PHPUnit\Framework\TestCase;
-
-class BitMatrixTest extends TestCase
-{
-    public function testGetSet() : void
-    {
-        $matrix = new BitMatrix(33);
-        $this->assertEquals(33, $matrix->getHeight());
-
-        for ($y = 0; $y < 33; ++$y) {
-            for ($x = 0; $x < 33; ++$x) {
-                if ($y * $x % 3 === 0) {
-                    $matrix->set($x, $y);
-                }
-            }
-        }
-
-        for ($y = 0; $y < 33; $y++) {
-            for ($x = 0; $x < 33; ++$x) {
-                $this->assertSame(0 === $x * $y % 3, $matrix->get($x, $y));
-            }
-        }
-    }
-
-    public function testSetRegion() : void
-    {
-        $matrix = new BitMatrix(5);
-        $matrix->setRegion(1, 1, 3, 3);
-
-        for ($y = 0; $y < 5; ++$y) {
-            for ($x = 0; $x < 5; ++$x) {
-                $this->assertSame($y >= 1 && $y <= 3 && $x >= 1 && $x <= 3, $matrix->get($x, $y));
-            }
-        }
-    }
-
-    public function testRectangularMatrix() : void
-    {
-        $matrix = new BitMatrix(75, 20);
-        $this->assertSame(75, $matrix->getWidth());
-        $this->assertSame(20, $matrix->getHeight());
-
-        $matrix->set(10, 0);
-        $matrix->set(11, 1);
-        $matrix->set(50, 2);
-        $matrix->set(51, 3);
-        $matrix->flip(74, 4);
-        $matrix->flip(0, 5);
-
-        $this->assertTrue($matrix->get(10, 0));
-        $this->assertTrue($matrix->get(11, 1));
-        $this->assertTrue($matrix->get(50, 2));
-        $this->assertTrue($matrix->get(51, 3));
-        $this->assertTrue($matrix->get(74, 4));
-        $this->assertTrue($matrix->get(0, 5));
-
-        $matrix->flip(50, 2);
-        $matrix->flip(51, 3);
-
-        $this->assertFalse($matrix->get(50, 2));
-        $this->assertFalse($matrix->get(51, 3));
-    }
-
-    public function testRectangularSetRegion() : void
-    {
-        $matrix = new BitMatrix(320, 240);
-        $this->assertSame(320, $matrix->getWidth());
-        $this->assertSame(240, $matrix->getHeight());
-
-        $matrix->setRegion(105, 22, 80, 12);
-
-        for ($y = 0; $y < 240; ++$y) {
-            for ($x = 0; $x < 320; ++$x) {
-                $this->assertEquals($y >= 22 && $y < 34 && $x >= 105 && $x < 185, $matrix->get($x, $y));
-            }
-        }
-    }
-
-    public function testGetRow() : void
-    {
-        $matrix = new BitMatrix(102, 5);
-
-        for ($x = 0; $x < 102; ++$x) {
-            if (0 === ($x & 3)) {
-                $matrix->set($x, 2);
-            }
-        }
-
-        $array1 = $matrix->getRow(2, null);
-        $this->assertSame(102, $array1->getSize());
-
-        $array2 = new BitArray(60);
-        $array2 = $matrix->getRow(2, $array2);
-        $this->assertSame(102, $array2->getSize());
-
-        $array3 = new BitArray(200);
-        $array3 = $matrix->getRow(2, $array3);
-        $this->assertSame(200, $array3->getSize());
-
-        for ($x = 0; $x < 102; ++$x) {
-            $on = (0 === ($x & 3));
-
-            $this->assertSame($on, $array1->get($x));
-            $this->assertSame($on, $array2->get($x));
-            $this->assertSame($on, $array3->get($x));
-        }
-    }
-}

+ 0 - 25
htdocs/includes/bacon/bacon-qr-code/test/Common/BitUtilsTest.php

@@ -1,25 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace BaconQrCodeTest\Common;
-
-use BaconQrCode\Common\BitUtils;
-use PHPUnit\Framework\TestCase;
-
-class BitUtilsTest extends TestCase
-{
-    public function testUnsignedRightShift() : void
-    {
-        $this->assertSame(1, BitUtils::unsignedRightShift(1, 0));
-        $this->assertSame(1, BitUtils::unsignedRightShift(10, 3));
-        $this->assertSame(536870910, BitUtils::unsignedRightShift(-10, 3));
-    }
-
-    public function testNumberOfTrailingZeros() : void
-    {
-        $this->assertSame(32, BitUtils::numberOfTrailingZeros(0));
-        $this->assertSame(1, BitUtils::numberOfTrailingZeros(10));
-        $this->assertSame(0, BitUtils::numberOfTrailingZeros(15));
-        $this->assertSame(2, BitUtils::numberOfTrailingZeros(20));
-    }
-}

+ 0 - 25
htdocs/includes/bacon/bacon-qr-code/test/Common/ErrorCorrectionLevelTest.php

@@ -1,25 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace BaconQrCodeTest\Common;
-
-use BaconQrCode\Common\ErrorCorrectionLevel;
-use BaconQrCode\Exception\OutOfBoundsException;
-use PHPUnit\Framework\TestCase;
-
-class ErrorCorrectionLevelTest extends TestCase
-{
-    public function testBitsMatchConstants() : void
-    {
-        $this->assertSame(0x0, ErrorCorrectionLevel::M()->getBits());
-        $this->assertSame(0x1, ErrorCorrectionLevel::L()->getBits());
-        $this->assertSame(0x2, ErrorCorrectionLevel::H()->getBits());
-        $this->assertSame(0x3, ErrorCorrectionLevel::Q()->getBits());
-    }
-
-    public function testInvalidErrorCorrectionLevelThrowsException() : void
-    {
-        $this->expectException(OutOfBoundsException::class);
-        ErrorCorrectionLevel::forBits(4);
-    }
-}

+ 0 - 94
htdocs/includes/bacon/bacon-qr-code/test/Common/FormatInformationTest.php

@@ -1,94 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace BaconQrCodeTest\Common;
-
-use BaconQrCode\Common\ErrorCorrectionLevel;
-use BaconQrCode\Common\FormatInformation;
-use PHPUnit\Framework\TestCase;
-
-class FormatInformationTest extends TestCase
-{
-    private const MASKED_TEST_FORMAT_INFO = 0x2bed;
-    private const UNMAKSED_TEST_FORMAT_INFO = self::MASKED_TEST_FORMAT_INFO ^ 0x5412;
-
-    public function testBitsDiffering() : void
-    {
-        $this->assertSame(0, FormatInformation::numBitsDiffering(1, 1));
-        $this->assertSame(1, FormatInformation::numBitsDiffering(0, 2));
-        $this->assertSame(2, FormatInformation::numBitsDiffering(1, 2));
-        $this->assertEquals(32, FormatInformation::numBitsDiffering(-1, 0));
-    }
-
-    public function testDecode() : void
-    {
-        $expected = FormatInformation::decodeFormatInformation(
-            self::MASKED_TEST_FORMAT_INFO,
-            self::MASKED_TEST_FORMAT_INFO
-        );
-
-        $this->assertNotNull($expected);
-        $this->assertSame(7, $expected->getDataMask());
-        $this->assertSame(ErrorCorrectionLevel::Q(), $expected->getErrorCorrectionLevel());
-
-        $this->assertEquals(
-            $expected,
-            FormatInformation::decodeFormatInformation(
-                self::UNMAKSED_TEST_FORMAT_INFO,
-                self::MASKED_TEST_FORMAT_INFO
-            )
-        );
-    }
-
-    public function testDecodeWithBitDifference() : void
-    {
-        $expected = FormatInformation::decodeFormatInformation(
-            self::MASKED_TEST_FORMAT_INFO,
-            self::MASKED_TEST_FORMAT_INFO
-        );
-
-        $this->assertEquals(
-            $expected,
-            FormatInformation::decodeFormatInformation(
-                self::MASKED_TEST_FORMAT_INFO ^ 0x1,
-                self::MASKED_TEST_FORMAT_INFO ^ 0x1
-            )
-        );
-        $this->assertEquals(
-            $expected,
-            FormatInformation::decodeFormatInformation(
-                self::MASKED_TEST_FORMAT_INFO ^ 0x3,
-                self::MASKED_TEST_FORMAT_INFO ^ 0x3
-            )
-        );
-        $this->assertEquals(
-            $expected,
-            FormatInformation::decodeFormatInformation(
-                self::MASKED_TEST_FORMAT_INFO ^ 0x7,
-                self::MASKED_TEST_FORMAT_INFO ^ 0x7
-            )
-        );
-        $this->assertNull(
-            FormatInformation::decodeFormatInformation(
-                self::MASKED_TEST_FORMAT_INFO ^ 0xf,
-                self::MASKED_TEST_FORMAT_INFO ^ 0xf
-            )
-        );
-    }
-
-    public function testDecodeWithMisRead() : void
-    {
-        $expected = FormatInformation::decodeFormatInformation(
-            self::MASKED_TEST_FORMAT_INFO,
-            self::MASKED_TEST_FORMAT_INFO
-        );
-
-        $this->assertEquals(
-            $expected,
-            FormatInformation::decodeFormatInformation(
-                self::MASKED_TEST_FORMAT_INFO ^ 0x3,
-                self::MASKED_TEST_FORMAT_INFO ^ 0xf
-            )
-        );
-    }
-}

+ 0 - 19
htdocs/includes/bacon/bacon-qr-code/test/Common/ModeTest.php

@@ -1,19 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace BaconQrCodeTest\Common;
-
-use BaconQrCode\Common\Mode;
-use PHPUnit\Framework\TestCase;
-
-class ModeTest extends TestCase
-{
-    public function testBitsMatchConstants() : void
-    {
-        $this->assertSame(0x0, Mode::TERMINATOR()->getBits());
-        $this->assertSame(0x1, Mode::NUMERIC()->getBits());
-        $this->assertSame(0x2, Mode::ALPHANUMERIC()->getBits());
-        $this->assertSame(0x4, Mode::BYTE()->getBits());
-        $this->assertSame(0x8, Mode::KANJI()->getBits());
-    }
-}

+ 0 - 96
htdocs/includes/bacon/bacon-qr-code/test/Common/ReedSolomonCodecTest.php

@@ -1,96 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace BaconQrCodeTest\Common;
-
-use BaconQrCode\Common\ReedSolomonCodec;
-use PHPUnit\Framework\TestCase;
-use SplFixedArray;
-
-class ReedSolomonTest extends TestCase
-{
-    public function tabs() : array
-    {
-        return [
-            [2, 0x7, 1, 1, 1],
-            [3, 0xb, 1, 1, 2],
-            [4, 0x13, 1, 1, 4],
-            [5, 0x25, 1, 1, 6],
-            [6, 0x43, 1, 1, 8],
-            [7, 0x89, 1, 1, 10],
-            [8, 0x11d, 1, 1, 32],
-        ];
-    }
-
-    /**
-     * @dataProvider tabs
-     */
-    public function testCodec(int $symbolSize, int $generatorPoly, int $firstRoot, int $primitive, int $numRoots) : void
-    {
-        mt_srand(0xdeadbeef, MT_RAND_PHP);
-
-        $blockSize = (1 << $symbolSize) - 1;
-        $dataSize  = $blockSize - $numRoots;
-        $codec     = new ReedSolomonCodec($symbolSize, $generatorPoly, $firstRoot, $primitive, $numRoots, 0);
-
-        for ($errors = 0; $errors <= $numRoots / 2; ++$errors) {
-            // Load block with random data and encode
-            $block = SplFixedArray::fromArray(array_fill(0, $blockSize, 0), false);
-
-            for ($i = 0; $i < $dataSize; ++$i) {
-                $block[$i] = mt_rand(0, $blockSize);
-            }
-
-            // Make temporary copy
-            $tBlock = clone $block;
-            $parity = SplFixedArray::fromArray(array_fill(0, $numRoots, 0), false);
-            $errorLocations = SplFixedArray::fromArray(array_fill(0, $blockSize, 0), false);
-            $erasures = [];
-
-            // Create parity
-            $codec->encode($block, $parity);
-
-            // Copy parity into test blocks
-            for ($i = 0; $i < $numRoots; ++$i) {
-                $block[$i + $dataSize] = $parity[$i];
-                $tBlock[$i + $dataSize] = $parity[$i];
-            }
-
-            // Seed with errors
-            for ($i = 0; $i < $errors; ++$i) {
-                $errorValue = mt_rand(1, $blockSize);
-
-                do {
-                    $errorLocation = mt_rand(0, $blockSize);
-                } while (0 !== $errorLocations[$errorLocation]);
-
-                $errorLocations[$errorLocation] = 1;
-
-                if (mt_rand(0, 1)) {
-                    $erasures[] = $errorLocation;
-                }
-
-                $tBlock[$errorLocation] ^= $errorValue;
-            }
-
-            $erasures = SplFixedArray::fromArray($erasures, false);
-
-            // Decode the errored block
-            $foundErrors = $codec->decode($tBlock, $erasures);
-
-            if ($errors > 0 && null === $foundErrors) {
-                $this->assertSame($block, $tBlock, 'Decoder failed to correct errors');
-            }
-
-            $this->assertSame($errors, $foundErrors, 'Found errors do not equal expected errors');
-
-            for ($i = 0; $i < $foundErrors; ++$i) {
-                if (0 === $errorLocations[$erasures[$i]]) {
-                    $this->fail(sprintf('Decoder indicates error in location %d without error', $erasures[$i]));
-                }
-            }
-
-            $this->assertEquals($block, $tBlock, 'Decoder did not correct errors');
-        }
-    }
-}

+ 0 - 78
htdocs/includes/bacon/bacon-qr-code/test/Common/VersionTest.php

@@ -1,78 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace BaconQrCodeTest\Common;
-
-use BaconQrCode\Common\ErrorCorrectionLevel;
-use BaconQrCode\Common\Version;
-use PHPUnit\Framework\TestCase;
-
-class VersionTest extends TestCase
-{
-    public function versions() : array
-    {
-        $array = [];
-
-        for ($i = 1; $i <= 40; ++$i) {
-            $array[] = [$i, 4 * $i + 17];
-        }
-
-        return $array;
-    }
-
-    public function decodeInformation() : array
-    {
-        return [
-            [7, 0x07c94],
-            [12, 0x0c762],
-            [17, 0x1145d],
-            [22, 0x168c9],
-            [27, 0x1b08e],
-            [32, 0x209d5],
-        ];
-    }
-
-    /**
-     * @dataProvider versions
-     */
-    public function testVersionForNumber(int $versionNumber, int $dimension) : void
-    {
-        $version = Version::getVersionForNumber($versionNumber);
-
-        $this->assertNotNull($version);
-        $this->assertEquals($versionNumber, $version->getVersionNumber());
-        $this->assertNotNull($version->getAlignmentPatternCenters());
-
-        if ($versionNumber > 1) {
-            $this->assertTrue(count($version->getAlignmentPatternCenters()) > 0);
-        }
-
-        $this->assertEquals($dimension, $version->getDimensionForVersion());
-        $this->assertNotNull($version->getEcBlocksForLevel(ErrorCorrectionLevel::H()));
-        $this->assertNotNull($version->getEcBlocksForLevel(ErrorCorrectionLevel::L()));
-        $this->assertNotNull($version->getEcBlocksForLevel(ErrorCorrectionLevel::M()));
-        $this->assertNotNull($version->getEcBlocksForLevel(ErrorCorrectionLevel::Q()));
-        $this->assertNotNull($version->buildFunctionPattern());
-    }
-
-    /**
-     * @dataProvider versions
-     */
-    public function testGetProvisionalVersionForDimension(int $versionNumber, int $dimension) : void
-    {
-        $this->assertSame(
-            $versionNumber,
-            Version::getProvisionalVersionForDimension($dimension)->getVersionNumber()
-        );
-    }
-
-    /**
-     * @dataProvider decodeInformation
-     */
-    public function testDecodeVersionInformation(int $expectedVersion, int $mask) : void
-    {
-        $version = Version::decodeVersionInformation($mask);
-        $this->assertNotNull($version);
-        $this->assertSame($expectedVersion, $version->getVersionNumber());
-    }
-}

+ 0 - 487
htdocs/includes/bacon/bacon-qr-code/test/Encoder/EncoderTest.php

@@ -1,487 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace BaconQrCodeTest\Encoder;
-
-use BaconQrCode\Common\BitArray;
-use BaconQrCode\Common\ErrorCorrectionLevel;
-use BaconQrCode\Common\Mode;
-use BaconQrCode\Common\Version;
-use BaconQrCode\Encoder\Encoder;
-use BaconQrCode\Exception\WriterException;
-use PHPUnit\Framework\TestCase;
-use ReflectionClass;
-use ReflectionMethod;
-use SplFixedArray;
-
-final class EncoderTest extends TestCase
-{
-    /**
-     * @var ReflectionMethod[]
-     */
-    protected $methods = [];
-
-    public function setUp() : void
-    {
-        // Hack to be able to test protected methods
-        $reflection = new ReflectionClass(Encoder::class);
-
-        foreach ($reflection->getMethods(ReflectionMethod::IS_STATIC) as $method) {
-            $method->setAccessible(true);
-            $this->methods[$method->getName()] = $method;
-        }
-    }
-
-    public function testGetAlphanumericCode() : void
-    {
-        // The first ten code points are numbers.
-        for ($i = 0; $i < 10; ++$i) {
-            $this->assertSame($i, $this->methods['getAlphanumericCode']->invoke(null, ord('0') + $i));
-        }
-
-        // The next 26 code points are capital alphabet letters.
-        for ($i = 10; $i < 36; ++$i) {
-            // The first ten code points are numbers
-            $this->assertSame($i, $this->methods['getAlphanumericCode']->invoke(null, ord('A') + $i - 10));
-        }
-
-        // Others are symbol letters.
-        $this->assertSame(36, $this->methods['getAlphanumericCode']->invoke(null, ord(' ')));
-        $this->assertSame(37, $this->methods['getAlphanumericCode']->invoke(null, ord('$')));
-        $this->assertSame(38, $this->methods['getAlphanumericCode']->invoke(null, ord('%')));
-        $this->assertSame(39, $this->methods['getAlphanumericCode']->invoke(null, ord('*')));
-        $this->assertSame(40, $this->methods['getAlphanumericCode']->invoke(null, ord('+')));
-        $this->assertSame(41, $this->methods['getAlphanumericCode']->invoke(null, ord('-')));
-        $this->assertSame(42, $this->methods['getAlphanumericCode']->invoke(null, ord('.')));
-        $this->assertSame(43, $this->methods['getAlphanumericCode']->invoke(null, ord('/')));
-        $this->assertSame(44, $this->methods['getAlphanumericCode']->invoke(null, ord(':')));
-
-        // Should return -1 for other letters.
-        $this->assertSame(-1, $this->methods['getAlphanumericCode']->invoke(null, ord('a')));
-        $this->assertSame(-1, $this->methods['getAlphanumericCode']->invoke(null, ord('#')));
-        $this->assertSame(-1, $this->methods['getAlphanumericCode']->invoke(null, ord("\0")));
-    }
-
-    public function testChooseMode() : void
-    {
-        // Numeric mode
-        $this->assertSame(Mode::NUMERIC(), $this->methods['chooseMode']->invoke(null, '0'));
-        $this->assertSame(Mode::NUMERIC(), $this->methods['chooseMode']->invoke(null, '0123456789'));
-
-        // Alphanumeric mode
-        $this->assertSame(Mode::ALPHANUMERIC(), $this->methods['chooseMode']->invoke(null, 'A'));
-        $this->assertSame(
-            Mode::ALPHANUMERIC(),
-            $this->methods['chooseMode']->invoke(null, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:')
-        );
-
-        // 8-bit byte mode
-        $this->assertSame(Mode::BYTE(), $this->methods['chooseMode']->invoke(null, 'a'));
-        $this->assertSame(Mode::BYTE(), $this->methods['chooseMode']->invoke(null, '#'));
-        $this->assertSame(Mode::BYTE(), $this->methods['chooseMode']->invoke(null, ''));
-
-        // AIUE in Hiragana in SHIFT-JIS
-        $this->assertSame(Mode::BYTE(), $this->methods['chooseMode']->invoke(null, "\x8\xa\x8\xa\x8\xa\x8\xa6"));
-
-        // Nihon in Kanji in SHIFT-JIS
-        $this->assertSame(Mode::BYTE(), $this->methods['chooseMode']->invoke(null, "\x9\xf\x9\x7b"));
-
-        // Sou-Utso-Byou in Kanji in SHIFT-JIS
-        $this->assertSame(Mode::BYTE(), $this->methods['chooseMode']->invoke(null, "\xe\x4\x9\x5\x9\x61"));
-    }
-
-    public function testEncode() : void
-    {
-        $qrCode = Encoder::encode('ABCDEF', ErrorCorrectionLevel::H());
-        $expected = "<<\n"
-            . " mode: ALPHANUMERIC\n"
-            . " ecLevel: H\n"
-            . " version: 1\n"
-            . " maskPattern: 0\n"
-            . " matrix:\n"
-            . " 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 1 1\n"
-            . " 1 0 0 0 0 0 1 0 0 1 1 1 0 0 1 0 0 0 0 0 1\n"
-            . " 1 0 1 1 1 0 1 0 0 1 0 1 1 0 1 0 1 1 1 0 1\n"
-            . " 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1\n"
-            . " 1 0 1 1 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1\n"
-            . " 1 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 1\n"
-            . " 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\n"
-            . " 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0\n"
-            . " 0 0 1 0 1 1 1 0 1 1 0 0 1 1 0 0 0 1 0 0 1\n"
-            . " 1 0 1 1 1 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0\n"
-            . " 0 0 1 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 1 0\n"
-            . " 1 1 0 1 0 1 0 1 1 1 0 1 0 1 0 0 0 0 0 1 0\n"
-            . " 0 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0\n"
-            . " 0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 0 0 0\n"
-            . " 1 1 1 1 1 1 1 0 0 0 1 0 1 0 1 1 0 0 0 0 1\n"
-            . " 1 0 0 0 0 0 1 0 1 1 1 1 0 1 0 1 1 1 1 0 1\n"
-            . " 1 0 1 1 1 0 1 0 1 0 1 1 0 1 0 1 0 0 0 0 1\n"
-            . " 1 0 1 1 1 0 1 0 0 1 1 0 1 1 1 1 0 1 0 1 0\n"
-            . " 1 0 1 1 1 0 1 0 1 0 0 0 1 0 1 0 1 1 1 0 1\n"
-            . " 1 0 0 0 0 0 1 0 0 1 1 0 1 1 0 1 0 0 0 1 1\n"
-            . " 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 1\n"
-            . ">>\n";
-
-        $this->assertSame($expected, (string) $qrCode);
-    }
-
-    public function testSimpleUtf8Eci() : void
-    {
-        $qrCode = Encoder::encode('hello', ErrorCorrectionLevel::H(), 'utf-8');
-        $expected = "<<\n"
-            . " mode: BYTE\n"
-            . " ecLevel: H\n"
-            . " version: 1\n"
-            . " maskPattern: 3\n"
-            . " matrix:\n"
-            . " 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1\n"
-            . " 1 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 1\n"
-            . " 1 0 1 1 1 0 1 0 0 1 0 1 0 0 1 0 1 1 1 0 1\n"
-            . " 1 0 1 1 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 0 1\n"
-            . " 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1\n"
-            . " 1 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1\n"
-            . " 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\n"
-            . " 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0\n"
-            . " 0 0 1 1 0 0 1 1 1 1 0 0 0 1 1 0 1 0 0 0 0\n"
-            . " 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0\n"
-            . " 0 1 0 1 0 1 1 1 0 1 0 1 0 0 0 0 0 1 1 1 1\n"
-            . " 1 1 0 0 1 0 0 1 1 0 0 1 1 1 1 0 1 0 1 1 0\n"
-            . " 0 0 0 0 1 0 1 1 1 1 0 0 0 0 0 1 0 0 1 0 0\n"
-            . " 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 0 0 0 1\n"
-            . " 1 1 1 1 1 1 1 0 1 1 1 0 1 0 1 1 0 0 1 0 0\n"
-            . " 1 0 0 0 0 0 1 0 0 0 1 0 0 1 1 1 1 1 1 0 1\n"
-            . " 1 0 1 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0\n"
-            . " 1 0 1 1 1 0 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0\n"
-            . " 1 0 1 1 1 0 1 0 1 1 0 0 0 1 0 0 1 0 0 0 0\n"
-            . " 1 0 0 0 0 0 1 0 0 0 0 1 1 0 1 0 1 0 1 1 0\n"
-            . " 1 1 1 1 1 1 1 0 0 1 0 1 1 1 0 1 1 0 0 0 0\n"
-            . ">>\n";
-
-        $this->assertSame($expected, (string) $qrCode);
-    }
-
-    public function testAppendModeInfo() : void
-    {
-        $bits = new BitArray();
-        $this->methods['appendModeInfo']->invoke(null, Mode::NUMERIC(), $bits);
-        $this->assertSame(' ...X', (string) $bits);
-    }
-
-    public function testAppendLengthInfo() : void
-    {
-        // 1 letter (1/1), 10 bits.
-        $bits = new BitArray();
-        $this->methods['appendLengthInfo']->invoke(
-            null,
-            1,
-            Version::getVersionForNumber(1),
-            Mode::NUMERIC(),
-            $bits
-        );
-        $this->assertSame(' ........ .X', (string) $bits);
-
-        // 2 letters (2/1), 11 bits.
-        $bits = new BitArray();
-        $this->methods['appendLengthInfo']->invoke(
-            null,
-            2,
-            Version::getVersionForNumber(10),
-            Mode::ALPHANUMERIC(),
-            $bits
-        );
-        $this->assertSame(' ........ .X.', (string) $bits);
-
-        // 255 letters (255/1), 16 bits.
-        $bits = new BitArray();
-        $this->methods['appendLengthInfo']->invoke(
-            null,
-            255,
-            Version::getVersionForNumber(27),
-            Mode::BYTE(),
-            $bits
-        );
-        $this->assertSame(' ........ XXXXXXXX', (string) $bits);
-
-        // 512 letters (1024/2), 12 bits.
-        $bits = new BitArray();
-        $this->methods['appendLengthInfo']->invoke(
-            null,
-            512,
-            Version::getVersionForNumber(40),
-            Mode::KANJI(),
-            $bits
-        );
-        $this->assertSame(' ..X..... ....', (string) $bits);
-    }
-
-    public function testAppendBytes() : void
-    {
-        // Should use appendNumericBytes.
-        // 1 = 01 = 0001 in 4 bits.
-        $bits = new BitArray();
-        $this->methods['appendBytes']->invoke(
-            null,
-            '1',
-            Mode::NUMERIC(),
-            $bits,
-            Encoder::DEFAULT_BYTE_MODE_ECODING
-        );
-        $this->assertSame(' ...X', (string) $bits);
-
-        // Should use appendAlphaNumericBytes.
-        // A = 10 = 0xa = 001010 in 6 bits.
-        $bits = new BitArray();
-        $this->methods['appendBytes']->invoke(
-            null,
-            'A',
-            Mode::ALPHANUMERIC(),
-            $bits,
-            Encoder::DEFAULT_BYTE_MODE_ECODING
-        );
-        $this->assertSame(' ..X.X.', (string) $bits);
-
-        // Should use append8BitBytes.
-        // 0x61, 0x62, 0x63
-        $bits = new BitArray();
-        $this->methods['appendBytes']->invoke(
-            null,
-            'abc',
-            Mode::BYTE(),
-            $bits,
-            Encoder::DEFAULT_BYTE_MODE_ECODING
-        );
-        $this->assertSame(' .XX....X .XX...X. .XX...XX', (string) $bits);
-
-        // Should use appendKanjiBytes.
-        // 0x93, 0x5f
-        $bits = new BitArray();
-        $this->methods['appendBytes']->invoke(
-            null,
-            "\x93\x5f",
-            Mode::KANJI(),
-            $bits,
-            Encoder::DEFAULT_BYTE_MODE_ECODING
-        );
-        $this->assertSame(' .XX.XX.. XXXXX', (string) $bits);
-
-        // Lower letters such as 'a' cannot be encoded in alphanumeric mode.
-        $this->expectException(WriterException::class);
-        $this->methods['appendBytes']->invoke(
-            null,
-            'a',
-            Mode::ALPHANUMERIC(),
-            $bits,
-            Encoder::DEFAULT_BYTE_MODE_ECODING
-        );
-    }
-
-    public function testTerminateBits() : void
-    {
-        $bits = new BitArray();
-        $this->methods['terminateBits']->invoke(null, 0, $bits);
-        $this->assertSame('', (string) $bits);
-
-        $bits = new BitArray();
-        $this->methods['terminateBits']->invoke(null, 1, $bits);
-        $this->assertSame(' ........', (string) $bits);
-
-        $bits = new BitArray();
-        $bits->appendBits(0, 3);
-        $this->methods['terminateBits']->invoke(null, 1, $bits);
-        $this->assertSame(' ........', (string) $bits);
-
-        $bits = new BitArray();
-        $bits->appendBits(0, 5);
-        $this->methods['terminateBits']->invoke(null, 1, $bits);
-        $this->assertSame(' ........', (string) $bits);
-
-        $bits = new BitArray();
-        $bits->appendBits(0, 8);
-        $this->methods['terminateBits']->invoke(null, 1, $bits);
-        $this->assertSame(' ........', (string) $bits);
-
-        $bits = new BitArray();
-        $this->methods['terminateBits']->invoke(null, 2, $bits);
-        $this->assertSame(' ........ XXX.XX..', (string) $bits);
-
-        $bits = new BitArray();
-        $bits->appendBits(0, 1);
-        $this->methods['terminateBits']->invoke(null, 3, $bits);
-        $this->assertSame(' ........ XXX.XX.. ...X...X', (string) $bits);
-    }
-
-    public function testGetNumDataBytesAndNumEcBytesForBlockId() : void
-    {
-        // Version 1-H.
-        list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']
-            ->invoke(null, 26, 9, 1, 0);
-        $this->assertSame(9, $numDataBytes);
-        $this->assertSame(17, $numEcBytes);
-
-        // Version 3-H.  2 blocks.
-        list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']
-            ->invoke(null, 70, 26, 2, 0);
-        $this->assertSame(13, $numDataBytes);
-        $this->assertSame(22, $numEcBytes);
-        list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']
-            ->invoke(null, 70, 26, 2, 1);
-        $this->assertSame(13, $numDataBytes);
-        $this->assertSame(22, $numEcBytes);
-
-        // Version 7-H. (4 + 1) blocks.
-        list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']
-            ->invoke(null, 196, 66, 5, 0);
-        $this->assertSame(13, $numDataBytes);
-        $this->assertSame(26, $numEcBytes);
-        list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']
-            ->invoke(null, 196, 66, 5, 4);
-        $this->assertSame(14, $numDataBytes);
-        $this->assertSame(26, $numEcBytes);
-
-        // Version 40-H. (20 + 61) blocks.
-        list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']
-            ->invoke(null, 3706, 1276, 81, 0);
-        $this->assertSame(15, $numDataBytes);
-        $this->assertSame(30, $numEcBytes);
-        list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']
-            ->invoke(null, 3706, 1276, 81, 20);
-        $this->assertSame(16, $numDataBytes);
-        $this->assertSame(30, $numEcBytes);
-        list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']
-            ->invoke(null, 3706, 1276, 81, 80);
-        $this->assertSame(16, $numDataBytes);
-        $this->assertSame(30, $numEcBytes);
-    }
-
-    public function testInterleaveWithEcBytes() : void
-    {
-        $dataBytes = SplFixedArray::fromArray([32, 65, 205, 69, 41, 220, 46, 128, 236], false);
-        $in        = new BitArray();
-
-        foreach ($dataBytes as $dataByte) {
-            $in->appendBits($dataByte, 8);
-        }
-
-        $outBits  = $this->methods['interleaveWithEcBytes']->invoke(null, $in, 26, 9, 1);
-        $expected = SplFixedArray::fromArray([
-            // Data bytes.
-            32, 65, 205, 69, 41, 220, 46, 128, 236,
-            // Error correction bytes.
-            42, 159, 74, 221, 244, 169, 239, 150, 138, 70, 237, 85, 224, 96, 74, 219, 61,
-        ], false);
-
-        $out = $outBits->toBytes(0, count($expected));
-
-        $this->assertEquals($expected, $out);
-    }
-
-    public function testAppendNumericBytes() : void
-    {
-        // 1 = 01 = 0001 in 4 bits.
-        $bits = new BitArray();
-        $this->methods['appendNumericBytes']->invoke(null, '1', $bits);
-        $this->assertSame(' ...X', (string) $bits);
-
-        // 12 = 0xc = 0001100 in 7 bits.
-        $bits = new BitArray();
-        $this->methods['appendNumericBytes']->invoke(null, '12', $bits);
-        $this->assertSame(' ...XX..', (string) $bits);
-
-        // 123 = 0x7b = 0001111011 in 10 bits.
-        $bits = new BitArray();
-        $this->methods['appendNumericBytes']->invoke(null, '123', $bits);
-        $this->assertSame(' ...XXXX. XX', (string) $bits);
-
-        // 1234 = "123" + "4" = 0001111011 + 0100 in 14 bits.
-        $bits = new BitArray();
-        $this->methods['appendNumericBytes']->invoke(null, '1234', $bits);
-        $this->assertSame(' ...XXXX. XX.X..', (string) $bits);
-
-        // Empty
-        $bits = new BitArray();
-        $this->methods['appendNumericBytes']->invoke(null, '', $bits);
-        $this->assertSame('', (string) $bits);
-    }
-
-    public function testAppendAlphanumericBytes() : void
-    {
-        $bits = new BitArray();
-        $this->methods['appendAlphanumericBytes']->invoke(null, 'A', $bits);
-        $this->assertSame(' ..X.X.', (string) $bits);
-
-        $bits = new BitArray();
-        $this->methods['appendAlphanumericBytes']->invoke(null, 'AB', $bits);
-        $this->assertSame(' ..XXX..X X.X', (string) $bits);
-
-        $bits = new BitArray();
-        $this->methods['appendAlphanumericBytes']->invoke(null, 'ABC', $bits);
-        $this->assertSame(' ..XXX..X X.X..XX. .', (string) $bits);
-
-        // Empty
-        $bits = new BitArray();
-        $this->methods['appendAlphanumericBytes']->invoke(null, '', $bits);
-        $this->assertSame('', (string) $bits);
-
-        // Invalid data
-        $this->expectException(WriterException::class);
-        $bits = new BitArray();
-        $this->methods['appendAlphanumericBytes']->invoke(null, 'abc', $bits);
-    }
-
-    public function testAppend8BitBytes() : void
-    {
-        // 0x61, 0x62, 0x63
-        $bits = new BitArray();
-        $this->methods['append8BitBytes']->invoke(null, 'abc', $bits, Encoder::DEFAULT_BYTE_MODE_ECODING);
-        $this->assertSame(' .XX....X .XX...X. .XX...XX', (string) $bits);
-
-        // Empty
-        $bits = new BitArray();
-        $this->methods['append8BitBytes']->invoke(null, '', $bits, Encoder::DEFAULT_BYTE_MODE_ECODING);
-        $this->assertSame('', (string) $bits);
-    }
-
-    public function testAppendKanjiBytes() : void
-    {
-        // Numbers are from page 21 of JISX0510:2004
-        $bits = new BitArray();
-        $this->methods['appendKanjiBytes']->invoke(null, "\x93\x5f", $bits);
-        $this->assertSame(' .XX.XX.. XXXXX', (string) $bits);
-
-        $this->methods['appendKanjiBytes']->invoke(null, "\xe4\xaa", $bits);
-        $this->assertSame(' .XX.XX.. XXXXXXX. X.X.X.X. X.', (string) $bits);
-    }
-
-    public function testGenerateEcBytes() : void
-    {
-        // Numbers are from http://www.swetake.com/qr/qr3.html and
-        // http://www.swetake.com/qr/qr9.html
-        $dataBytes = SplFixedArray::fromArray([32, 65, 205, 69, 41, 220, 46, 128, 236], false);
-        $ecBytes   = $this->methods['generateEcBytes']->invoke(null, $dataBytes, 17);
-        $expected  = SplFixedArray::fromArray(
-            [42, 159, 74, 221, 244, 169, 239, 150, 138, 70, 237, 85, 224, 96, 74, 219, 61],
-            false
-        );
-        $this->assertEquals($expected, $ecBytes);
-
-        $dataBytes = SplFixedArray::fromArray(
-            [67, 70, 22, 38, 54, 70, 86, 102, 118, 134, 150, 166, 182, 198, 214],
-            false
-        );
-        $ecBytes   = $this->methods['generateEcBytes']->invoke(null, $dataBytes, 18);
-        $expected  = SplFixedArray::fromArray(
-            [175, 80, 155, 64, 178, 45, 214, 233, 65, 209, 12, 155, 117, 31, 140, 214, 27, 187],
-            false
-        );
-        $this->assertEquals($expected, $ecBytes);
-
-        // High-order zero coefficient case.
-        $dataBytes = SplFixedArray::fromArray([32, 49, 205, 69, 42, 20, 0, 236, 17], false);
-        $ecBytes   = $this->methods['generateEcBytes']->invoke(null, $dataBytes, 17);
-        $expected  = SplFixedArray::fromArray(
-            [0, 3, 130, 179, 194, 0, 55, 211, 110, 79, 98, 72, 170, 96, 211, 137, 213],
-            false
-        );
-        $this->assertEquals($expected, $ecBytes);
-    }
-}

+ 0 - 251
htdocs/includes/bacon/bacon-qr-code/test/Encoder/MaskUtilTest.php

@@ -1,251 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace BaconQrCodeTest\Encoder;
-
-use BaconQrCode\Encoder\ByteMatrix;
-use BaconQrCode\Encoder\MaskUtil;
-use PHPUnit\Framework\TestCase;
-
-class MaskUtilTest extends TestCase
-{
-    public function dataMaskBits() : array
-    {
-        return [
-            [0, [
-                [1, 0, 1, 0, 1, 0],
-                [0, 1, 0, 1, 0, 1],
-                [1, 0, 1, 0, 1, 0],
-                [0, 1, 0, 1, 0, 1],
-                [1, 0, 1, 0, 1, 0],
-                [0, 1, 0, 1, 0, 1],
-            ]],
-            [1, [
-                [1, 1, 1, 1, 1, 1],
-                [0, 0, 0, 0, 0, 0],
-                [1, 1, 1, 1, 1, 1],
-                [0, 0, 0, 0, 0, 0],
-                [1, 1, 1, 1, 1, 1],
-                [0, 0, 0, 0, 0, 0],
-            ]],
-            [2, [
-                [1, 0, 0, 1, 0, 0],
-                [1, 0, 0, 1, 0, 0],
-                [1, 0, 0, 1, 0, 0],
-                [1, 0, 0, 1, 0, 0],
-                [1, 0, 0, 1, 0, 0],
-                [1, 0, 0, 1, 0, 0],
-            ]],
-            [3, [
-                [1, 0, 0, 1, 0, 0],
-                [0, 0, 1, 0, 0, 1],
-                [0, 1, 0, 0, 1, 0],
-                [1, 0, 0, 1, 0, 0],
-                [0, 0, 1, 0, 0, 1],
-                [0, 1, 0, 0, 1, 0],
-            ]],
-            [4, [
-                [1, 1, 1, 0, 0, 0],
-                [1, 1, 1, 0, 0, 0],
-                [0, 0, 0, 1, 1, 1],
-                [0, 0, 0, 1, 1, 1],
-                [1, 1, 1, 0, 0, 0],
-                [1, 1, 1, 0, 0, 0],
-            ]],
-            [5, [
-                [1, 1, 1, 1, 1, 1],
-                [1, 0, 0, 0, 0, 0],
-                [1, 0, 0, 1, 0, 0],
-                [1, 0, 1, 0, 1, 0],
-                [1, 0, 0, 1, 0, 0],
-                [1, 0, 0, 0, 0, 0],
-            ]],
-            [6, [
-                [1, 1, 1, 1, 1, 1],
-                [1, 1, 1, 0, 0, 0],
-                [1, 1, 0, 1, 1, 0],
-                [1, 0, 1, 0, 1, 0],
-                [1, 0, 1, 1, 0, 1],
-                [1, 0, 0, 0, 1, 1],
-            ]],
-            [7, [
-                [1, 0, 1, 0, 1, 0],
-                [0, 0, 0, 1, 1, 1],
-                [1, 0, 0, 0, 1, 1],
-                [0, 1, 0, 1, 0, 1],
-                [1, 1, 1, 0, 0, 0],
-                [0, 1, 1, 1, 0, 0],
-            ]],
-        ];
-    }
-
-    /**
-     * @dataProvider dataMaskBits
-     */
-    public function testGetDatMaskBit(int $maskPattern, array $expected) : void
-    {
-        for ($x = 0; $x < 6; ++$x) {
-            for ($y = 0; $y < 6; ++$y) {
-                $this->assertSame(
-                    1 === $expected[$y][$x],
-                    MaskUtil::getDataMaskBit($maskPattern, $x, $y)
-                );
-            }
-        }
-    }
-
-    public function testApplyMaskPenaltyRule1() : void
-    {
-        $matrix = new ByteMatrix(4, 1);
-        $matrix->set(0, 0, 0);
-        $matrix->set(1, 0, 0);
-        $matrix->set(2, 0, 0);
-        $matrix->set(3, 0, 0);
-
-        $this->assertSame(0, MaskUtil::applyMaskPenaltyRule1($matrix));
-
-        // Horizontal
-        $matrix = new ByteMatrix(6, 1);
-        $matrix->set(0, 0, 0);
-        $matrix->set(1, 0, 0);
-        $matrix->set(2, 0, 0);
-        $matrix->set(3, 0, 0);
-        $matrix->set(4, 0, 0);
-        $matrix->set(5, 0, 1);
-        $this->assertSame(3, MaskUtil::applyMaskPenaltyRule1($matrix));
-        $matrix->set(5, 0, 0);
-        $this->assertSame(4, MaskUtil::applyMaskPenaltyRule1($matrix));
-
-        // Vertical
-        $matrix = new ByteMatrix(1, 6);
-        $matrix->set(0, 0, 0);
-        $matrix->set(0, 1, 0);
-        $matrix->set(0, 2, 0);
-        $matrix->set(0, 3, 0);
-        $matrix->set(0, 4, 0);
-        $matrix->set(0, 5, 1);
-        $this->assertSame(3, MaskUtil::applyMaskPenaltyRule1($matrix));
-        $matrix->set(0, 5, 0);
-        $this->assertSame(4, MaskUtil::applyMaskPenaltyRule1($matrix));
-    }
-
-    public function testApplyMaskPenaltyRule2() : void
-    {
-        $matrix = new ByteMatrix(1, 1);
-        $matrix->set(0, 0, 0);
-        $this->assertSame(0, MaskUtil::applyMaskPenaltyRule2($matrix));
-
-        $matrix = new ByteMatrix(2, 2);
-        $matrix->set(0, 0, 0);
-        $matrix->set(1, 0, 0);
-        $matrix->set(0, 1, 0);
-        $matrix->set(1, 1, 1);
-        $this->assertSame(0, MaskUtil::applyMaskPenaltyRule2($matrix));
-
-        $matrix = new ByteMatrix(2, 2);
-        $matrix->set(0, 0, 0);
-        $matrix->set(1, 0, 0);
-        $matrix->set(0, 1, 0);
-        $matrix->set(1, 1, 0);
-        $this->assertSame(3, MaskUtil::applyMaskPenaltyRule2($matrix));
-
-        $matrix = new ByteMatrix(3, 3);
-        $matrix->set(0, 0, 0);
-        $matrix->set(1, 0, 0);
-        $matrix->set(2, 0, 0);
-        $matrix->set(0, 1, 0);
-        $matrix->set(1, 1, 0);
-        $matrix->set(2, 1, 0);
-        $matrix->set(0, 2, 0);
-        $matrix->set(1, 2, 0);
-        $matrix->set(2, 2, 0);
-        $this->assertSame(3 * 4, MaskUtil::applyMaskPenaltyRule2($matrix));
-    }
-
-    public function testApplyMaskPenalty3() : void
-    {
-        // Horizontal 00001011101
-        $matrix = new ByteMatrix(11, 1);
-        $matrix->set(0, 0, 0);
-        $matrix->set(1, 0, 0);
-        $matrix->set(2, 0, 0);
-        $matrix->set(3, 0, 0);
-        $matrix->set(4, 0, 1);
-        $matrix->set(5, 0, 0);
-        $matrix->set(6, 0, 1);
-        $matrix->set(7, 0, 1);
-        $matrix->set(8, 0, 1);
-        $matrix->set(9, 0, 0);
-        $matrix->set(10, 0, 1);
-        $this->assertSame(40, MaskUtil::applyMaskPenaltyRule3($matrix));
-
-        // Horizontal 10111010000
-        $matrix = new ByteMatrix(11, 1);
-        $matrix->set(0, 0, 1);
-        $matrix->set(1, 0, 0);
-        $matrix->set(2, 0, 1);
-        $matrix->set(3, 0, 1);
-        $matrix->set(4, 0, 1);
-        $matrix->set(5, 0, 0);
-        $matrix->set(6, 0, 1);
-        $matrix->set(7, 0, 0);
-        $matrix->set(8, 0, 0);
-        $matrix->set(9, 0, 0);
-        $matrix->set(10, 0, 0);
-        $this->assertSame(40, MaskUtil::applyMaskPenaltyRule3($matrix));
-
-        // Vertical 00001011101
-        $matrix = new ByteMatrix(1, 11);
-        $matrix->set(0, 0, 0);
-        $matrix->set(0, 1, 0);
-        $matrix->set(0, 2, 0);
-        $matrix->set(0, 3, 0);
-        $matrix->set(0, 4, 1);
-        $matrix->set(0, 5, 0);
-        $matrix->set(0, 6, 1);
-        $matrix->set(0, 7, 1);
-        $matrix->set(0, 8, 1);
-        $matrix->set(0, 9, 0);
-        $matrix->set(0, 10, 1);
-        $this->assertSame(40, MaskUtil::applyMaskPenaltyRule3($matrix));
-
-        // Vertical 10111010000
-        $matrix = new ByteMatrix(1, 11);
-        $matrix->set(0, 0, 1);
-        $matrix->set(0, 1, 0);
-        $matrix->set(0, 2, 1);
-        $matrix->set(0, 3, 1);
-        $matrix->set(0, 4, 1);
-        $matrix->set(0, 5, 0);
-        $matrix->set(0, 6, 1);
-        $matrix->set(0, 7, 0);
-        $matrix->set(0, 8, 0);
-        $matrix->set(0, 9, 0);
-        $matrix->set(0, 10, 0);
-        $this->assertSame(40, MaskUtil::applyMaskPenaltyRule3($matrix));
-    }
-
-    public function testApplyMaskPenaltyRule4() : void
-    {
-        // Dark cell ratio = 0%
-        $matrix = new ByteMatrix(1, 1);
-        $matrix->set(0, 0, 0);
-        $this->assertSame(100, MaskUtil::applyMaskPenaltyRule4($matrix));
-
-        // Dark cell ratio = 5%
-        $matrix = new ByteMatrix(2, 1);
-        $matrix->set(0, 0, 0);
-        $matrix->set(0, 0, 1);
-        $this->assertSame(0, MaskUtil::applyMaskPenaltyRule4($matrix));
-
-        // Dark cell ratio = 66.67%
-        $matrix = new ByteMatrix(6, 1);
-        $matrix->set(0, 0, 0);
-        $matrix->set(1, 0, 1);
-        $matrix->set(2, 0, 1);
-        $matrix->set(3, 0, 1);
-        $matrix->set(4, 0, 1);
-        $matrix->set(5, 0, 0);
-        $this->assertSame(30, MaskUtil::applyMaskPenaltyRule4($matrix));
-    }
-}

+ 0 - 335
htdocs/includes/bacon/bacon-qr-code/test/Encoder/MatrixUtilTest.php

@@ -1,335 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace BaconQrCodeTest\Encoder;
-
-use BaconQrCode\Common\BitArray;
-use BaconQrCode\Common\ErrorCorrectionLevel;
-use BaconQrCode\Common\Version;
-use BaconQrCode\Encoder\ByteMatrix;
-use BaconQrCode\Encoder\MatrixUtil;
-use PHPUnit\Framework\TestCase;
-use ReflectionClass;
-use ReflectionMethod;
-
-class MatrixUtilTest extends TestCase
-{
-    /**
-     * @var ReflectionMethod[]
-     */
-    protected $methods = [];
-
-    public function setUp() : void
-    {
-        // Hack to be able to test protected methods
-        $reflection = new ReflectionClass(MatrixUtil::class);
-
-        foreach ($reflection->getMethods(ReflectionMethod::IS_STATIC) as $method) {
-            $method->setAccessible(true);
-            $this->methods[$method->getName()] = $method;
-        }
-    }
-
-    public function testToString() : void
-    {
-        $matrix = new ByteMatrix(3, 3);
-        $matrix->set(0, 0, 0);
-        $matrix->set(1, 0, 1);
-        $matrix->set(2, 0, 0);
-        $matrix->set(0, 1, 1);
-        $matrix->set(1, 1, 0);
-        $matrix->set(2, 1, 1);
-        $matrix->set(0, 2, -1);
-        $matrix->set(1, 2, -1);
-        $matrix->set(2, 2, -1);
-
-        $expected = " 0 1 0\n 1 0 1\n      \n";
-        $this->assertSame($expected, (string) $matrix);
-    }
-
-    public function testClearMatrix() : void
-    {
-        $matrix = new ByteMatrix(2, 2);
-        MatrixUtil::clearMatrix($matrix);
-
-        $this->assertSame(-1, $matrix->get(0, 0));
-        $this->assertSame(-1, $matrix->get(1, 0));
-        $this->assertSame(-1, $matrix->get(0, 1));
-        $this->assertSame(-1, $matrix->get(1, 1));
-    }
-
-    public function testEmbedBasicPatterns1() : void
-    {
-        $matrix = new ByteMatrix(21, 21);
-        MatrixUtil::clearMatrix($matrix);
-        $this->methods['embedBasicPatterns']->invoke(
-            null,
-            Version::getVersionForNumber(1),
-            $matrix
-        );
-        $expected = " 1 1 1 1 1 1 1 0           0 1 1 1 1 1 1 1\n"
-                  . " 1 0 0 0 0 0 1 0           0 1 0 0 0 0 0 1\n"
-                  . " 1 0 1 1 1 0 1 0           0 1 0 1 1 1 0 1\n"
-                  . " 1 0 1 1 1 0 1 0           0 1 0 1 1 1 0 1\n"
-                  . " 1 0 1 1 1 0 1 0           0 1 0 1 1 1 0 1\n"
-                  . " 1 0 0 0 0 0 1 0           0 1 0 0 0 0 0 1\n"
-                  . " 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\n"
-                  . " 0 0 0 0 0 0 0 0           0 0 0 0 0 0 0 0\n"
-                  . "             1                            \n"
-                  . "             0                            \n"
-                  . "             1                            \n"
-                  . "             0                            \n"
-                  . "             1                            \n"
-                  . " 0 0 0 0 0 0 0 0 1                        \n"
-                  . " 1 1 1 1 1 1 1 0                          \n"
-                  . " 1 0 0 0 0 0 1 0                          \n"
-                  . " 1 0 1 1 1 0 1 0                          \n"
-                  . " 1 0 1 1 1 0 1 0                          \n"
-                  . " 1 0 1 1 1 0 1 0                          \n"
-                  . " 1 0 0 0 0 0 1 0                          \n"
-                  . " 1 1 1 1 1 1 1 0                          \n";
-
-        $this->assertSame($expected, (string) $matrix);
-    }
-
-    public function testEmbedBasicPatterns2() : void
-    {
-        $matrix = new ByteMatrix(25, 25);
-        MatrixUtil::clearMatrix($matrix);
-        $this->methods['embedBasicPatterns']->invoke(
-            null,
-            Version::getVersionForNumber(2),
-            $matrix
-        );
-        $expected = " 1 1 1 1 1 1 1 0                   0 1 1 1 1 1 1 1\n"
-                  . " 1 0 0 0 0 0 1 0                   0 1 0 0 0 0 0 1\n"
-                  . " 1 0 1 1 1 0 1 0                   0 1 0 1 1 1 0 1\n"
-                  . " 1 0 1 1 1 0 1 0                   0 1 0 1 1 1 0 1\n"
-                  . " 1 0 1 1 1 0 1 0                   0 1 0 1 1 1 0 1\n"
-                  . " 1 0 0 0 0 0 1 0                   0 1 0 0 0 0 0 1\n"
-                  . " 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\n"
-                  . " 0 0 0 0 0 0 0 0                   0 0 0 0 0 0 0 0\n"
-                  . "             1                                    \n"
-                  . "             0                                    \n"
-                  . "             1                                    \n"
-                  . "             0                                    \n"
-                  . "             1                                    \n"
-                  . "             0                                    \n"
-                  . "             1                                    \n"
-                  . "             0                                    \n"
-                  . "             1                   1 1 1 1 1        \n"
-                  . " 0 0 0 0 0 0 0 0 1               1 0 0 0 1        \n"
-                  . " 1 1 1 1 1 1 1 0                 1 0 1 0 1        \n"
-                  . " 1 0 0 0 0 0 1 0                 1 0 0 0 1        \n"
-                  . " 1 0 1 1 1 0 1 0                 1 1 1 1 1        \n"
-                  . " 1 0 1 1 1 0 1 0                                  \n"
-                  . " 1 0 1 1 1 0 1 0                                  \n"
-                  . " 1 0 0 0 0 0 1 0                                  \n"
-                  . " 1 1 1 1 1 1 1 0                                  \n";
-
-        $this->assertSame($expected, (string) $matrix);
-    }
-
-    public function testEmbedTypeInfo() : void
-    {
-        $matrix = new ByteMatrix(21, 21);
-        MatrixUtil::clearMatrix($matrix);
-        $this->methods['embedTypeInfo']->invoke(
-            null,
-            ErrorCorrectionLevel::M(),
-            5,
-            $matrix
-        );
-        $expected = "                 0                        \n"
-                  . "                 1                        \n"
-                  . "                 1                        \n"
-                  . "                 1                        \n"
-                  . "                 0                        \n"
-                  . "                 0                        \n"
-                  . "                                          \n"
-                  . "                 1                        \n"
-                  . " 1 0 0 0 0 0   0 1         1 1 0 0 1 1 1 0\n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . "                 0                        \n"
-                  . "                 0                        \n"
-                  . "                 0                        \n"
-                  . "                 0                        \n"
-                  . "                 0                        \n"
-                  . "                 0                        \n"
-                  . "                 1                        \n";
-
-        $this->assertSame($expected, (string) $matrix);
-    }
-
-    public function testEmbedVersionInfo() : void
-    {
-        $matrix = new ByteMatrix(21, 21);
-        MatrixUtil::clearMatrix($matrix);
-        $this->methods['maybeEmbedVersionInfo']->invoke(
-            null,
-            Version::getVersionForNumber(7),
-            $matrix
-        );
-        $expected = "                     0 0 1                \n"
-                  . "                     0 1 0                \n"
-                  . "                     0 1 0                \n"
-                  . "                     0 1 1                \n"
-                  . "                     1 1 1                \n"
-                  . "                     0 0 0                \n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . " 0 0 0 0 1 0                              \n"
-                  . " 0 1 1 1 1 0                              \n"
-                  . " 1 0 0 1 1 0                              \n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . "                                          \n"
-                  . "                                          \n";
-
-        $this->assertSame($expected, (string) $matrix);
-    }
-
-    public function testEmbedDataBits() : void
-    {
-        $matrix = new ByteMatrix(21, 21);
-        MatrixUtil::clearMatrix($matrix);
-        $this->methods['embedBasicPatterns']->invoke(
-            null,
-            Version::getVersionForNumber(1),
-            $matrix
-        );
-
-        $bits = new BitArray();
-        $this->methods['embedDataBits']->invoke(
-            null,
-            $bits,
-            -1,
-            $matrix
-        );
-
-        $expected = " 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1\n"
-                  . " 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1\n"
-                  . " 1 0 1 1 1 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1\n"
-                  . " 1 0 1 1 1 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1\n"
-                  . " 1 0 1 1 1 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1\n"
-                  . " 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1\n"
-                  . " 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\n"
-                  . " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
-                  . " 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n";
-
-        $this->assertSame($expected, (string) $matrix);
-    }
-
-    public function testBuildMatrix() : void
-    {
-        $bytes = [
-            32, 65, 205, 69, 41, 220, 46, 128, 236, 42, 159, 74, 221, 244, 169,
-            239, 150, 138, 70, 237, 85, 224, 96, 74, 219 , 61
-        ];
-        $bits = new BitArray();
-
-        foreach ($bytes as $byte) {
-            $bits->appendBits($byte, 8);
-        }
-
-        $matrix = new ByteMatrix(21, 21);
-        MatrixUtil::buildMatrix(
-            $bits,
-            ErrorCorrectionLevel::H(),
-            Version::getVersionForNumber(1),
-            3,
-            $matrix
-        );
-
-        $expected = " 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1 1 1 1 1 1\n"
-                  . " 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1\n"
-                  . " 1 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 1 1 0 1\n"
-                  . " 1 0 1 1 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1\n"
-                  . " 1 0 1 1 1 0 1 0 1 1 0 0 1 0 1 0 1 1 1 0 1\n"
-                  . " 1 0 0 0 0 0 1 0 0 0 1 1 1 0 1 0 0 0 0 0 1\n"
-                  . " 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\n"
-                  . " 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0\n"
-                  . " 0 0 1 1 0 0 1 1 1 0 0 1 1 1 1 0 1 0 0 0 0\n"
-                  . " 1 0 1 0 1 0 0 0 0 0 1 1 1 0 0 1 0 1 1 1 0\n"
-                  . " 1 1 1 1 0 1 1 0 1 0 1 1 1 0 0 1 1 1 0 1 0\n"
-                  . " 1 0 1 0 1 1 0 1 1 1 0 0 1 1 1 0 0 1 0 1 0\n"
-                  . " 0 0 1 0 0 1 1 1 0 0 0 0 0 0 1 0 1 1 1 1 1\n"
-                  . " 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 1 0 1 1\n"
-                  . " 1 1 1 1 1 1 1 0 1 1 1 1 0 0 0 0 1 0 1 1 0\n"
-                  . " 1 0 0 0 0 0 1 0 0 0 0 1 0 1 1 1 0 0 0 0 0\n"
-                  . " 1 0 1 1 1 0 1 0 0 1 0 0 1 1 0 0 1 0 0 1 1\n"
-                  . " 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0 0 0 1 1 1 0\n"
-                  . " 1 0 1 1 1 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 0\n"
-                  . " 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0\n"
-                  . " 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 1 0 0 1 0\n";
-
-        $this->assertSame($expected, (string) $matrix);
-    }
-
-    public function testFindMsbSet() : void
-    {
-        $this->assertSame(0, $this->methods['findMsbSet']->invoke(null, 0));
-        $this->assertSame(1, $this->methods['findMsbSet']->invoke(null, 1));
-        $this->assertSame(8, $this->methods['findMsbSet']->invoke(null, 0x80));
-        $this->assertSame(32, $this->methods['findMsbSet']->invoke(null, 0x80000000));
-    }
-
-    public function testCalculateBchCode() : void
-    {
-        // Encoding of type information.
-        // From Appendix C in JISX0510:2004 (p 65)
-        $this->assertSame(0xdc, $this->methods['calculateBchCode']->invoke(null, 5, 0x537));
-        // From http://www.swetake.com/qr/qr6.html
-        $this->assertSame(0x1c2, $this->methods['calculateBchCode']->invoke(null, 0x13, 0x537));
-        // From http://www.swetake.com/qr/qr11.html
-        $this->assertSame(0x214, $this->methods['calculateBchCode']->invoke(null, 0x1b, 0x537));
-
-        // Encoding of version information.
-        // From Appendix D in JISX0510:2004 (p 68)
-        $this->assertSame(0xc94, $this->methods['calculateBchCode']->invoke(null, 7, 0x1f25));
-        $this->assertSame(0x5bc, $this->methods['calculateBchCode']->invoke(null, 8, 0x1f25));
-        $this->assertSame(0xa99, $this->methods['calculateBchCode']->invoke(null, 9, 0x1f25));
-        $this->assertSame(0x4d3, $this->methods['calculateBchCode']->invoke(null, 10, 0x1f25));
-        $this->assertSame(0x9a6, $this->methods['calculateBchCode']->invoke(null, 20, 0x1f25));
-        $this->assertSame(0xd75, $this->methods['calculateBchCode']->invoke(null, 30, 0x1f25));
-        $this->assertSame(0xc69, $this->methods['calculateBchCode']->invoke(null, 40, 0x1f25));
-    }
-
-    public function testMakeVersionInfoBits() : void
-    {
-        // From Appendix D in JISX0510:2004 (p 68)
-        $bits = new BitArray();
-        $this->methods['makeVersionInfoBits']->invoke(null, Version::getVersionForNumber(7), $bits);
-        $this->assertSame(' ...XXXXX ..X..X.X ..', (string) $bits);
-    }
-
-    public function testMakeTypeInfoBits() : void
-    {
-        // From Appendix D in JISX0510:2004 (p 68)
-        $bits = new BitArray();
-        $this->methods['makeTypeInfoBits']->invoke(null, ErrorCorrectionLevel::M(), 5, $bits);
-        $this->assertSame(' X......X X..XXX.', (string) $bits);
-    }
-}

+ 0 - 72
htdocs/includes/bacon/bacon-qr-code/test/Integration/ImagickRenderingTest.php

@@ -1,72 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace BaconQrCodeTest\Integration;
-
-use BaconQrCode\Renderer\Color\Rgb;
-use BaconQrCode\Renderer\Eye\SquareEye;
-use BaconQrCode\Renderer\Image\ImagickImageBackEnd;
-use BaconQrCode\Renderer\ImageRenderer;
-use BaconQrCode\Renderer\Module\SquareModule;
-use BaconQrCode\Renderer\RendererStyle\EyeFill;
-use BaconQrCode\Renderer\RendererStyle\Fill;
-use BaconQrCode\Renderer\RendererStyle\Gradient;
-use BaconQrCode\Renderer\RendererStyle\GradientType;
-use BaconQrCode\Renderer\RendererStyle\RendererStyle;
-use BaconQrCode\Writer;
-use PHPUnit\Framework\TestCase;
-use Spatie\Snapshots\MatchesSnapshots;
-
-/**
- * @group integration
- */
-final class ImagickRenderingTest extends TestCase
-{
-    use MatchesSnapshots;
-
-    /**
-     * @requires extension imagick
-     */
-    public function testGenericQrCode() : void
-    {
-        $renderer = new ImageRenderer(
-            new RendererStyle(400),
-            new ImagickImageBackEnd()
-        );
-        $writer = new Writer($renderer);
-        $tempName = tempnam(sys_get_temp_dir(), 'test') . '.png';
-        $writer->writeFile('Hello World!', $tempName);
-
-        $this->assertMatchesFileSnapshot($tempName);
-        unlink($tempName);
-    }
-
-    /**
-     * @requires extension imagick
-     */
-    public function testIssue79() : void
-    {
-        $eye = SquareEye::instance();
-        $squareModule = SquareModule::instance();
-
-        $eyeFill = new EyeFill(new Rgb(100, 100, 55), new Rgb(100, 100, 255));
-        $gradient = new Gradient(new Rgb(100, 100, 55), new Rgb(100, 100, 255), GradientType::HORIZONTAL());
-
-        $renderer = new ImageRenderer(
-            new RendererStyle(
-                400,
-                2,
-                $squareModule,
-                $eye,
-                Fill::withForegroundGradient(new Rgb(255, 255, 255), $gradient, $eyeFill, $eyeFill, $eyeFill)
-            ),
-            new ImagickImageBackEnd()
-        );
-        $writer = new Writer($renderer);
-        $tempName = tempnam(sys_get_temp_dir(), 'test') . '.png';
-        $writer->writeFile('https://apiroad.net/very-long-url', $tempName);
-
-        $this->assertMatchesFileSnapshot($tempName);
-        unlink($tempName);
-    }
-}

二进制
htdocs/includes/bacon/bacon-qr-code/test/Integration/__snapshots__/files/ImagickRenderingTest__testGenericQrCode__1.png


二进制
htdocs/includes/bacon/bacon-qr-code/test/Integration/__snapshots__/files/ImagickRenderingTest__testIssue79__1.png


+ 0 - 0
htdocs/includes/dasprid/enum/composer.json → htdocs/includes/dasprid/enum/composer.json.disabled


+ 0 - 17
htdocs/includes/dasprid/enum/phpunit.xml.dist

@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
-         bootstrap="vendor/autoload.php"
-         colors="true">
-    <testsuites>
-        <testsuite name="DASPRiD\\Enum Tests">
-            <directory>./test</directory>
-        </testsuite>
-    </testsuites>
-
-    <filter>
-        <whitelist processUncoveredFilesFromWhitelist="true">
-            <directory suffix=".php">src</directory>
-        </whitelist>
-    </filter>
-</phpunit>

+ 0 - 121
htdocs/includes/dasprid/enum/test/AbstractEnumTest.php

@@ -1,121 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace DASPRiD\EnumTest;
-
-use DASPRiD\Enum\AbstractEnum;
-use DASPRiD\Enum\Exception\CloneNotSupportedException;
-use DASPRiD\Enum\Exception\IllegalArgumentException;
-use DASPRiD\Enum\Exception\MismatchException;
-use DASPRiD\Enum\Exception\SerializeNotSupportedException;
-use DASPRiD\Enum\Exception\UnserializeNotSupportedException;
-use PHPUnit\Framework\TestCase;
-use ReflectionClass;
-
-final class AbstractEnumTest extends TestCase
-{
-    public function setUp(): void
-    {
-        $reflectionClass = new ReflectionClass(AbstractEnum::class);
-
-        $constantsProperty = $reflectionClass->getProperty('constants');
-        $constantsProperty->setAccessible(true);
-        $constantsProperty->setValue([]);
-
-        $valuesProperty = $reflectionClass->getProperty('values');
-        $valuesProperty->setAccessible(true);
-        $valuesProperty->setValue([]);
-
-        $allValuesLoadedProperty = $reflectionClass->getProperty('allValuesLoaded');
-        $allValuesLoadedProperty->setAccessible(true);
-        $allValuesLoadedProperty->setValue([]);
-    }
-
-    public function testToString() : void
-    {
-        $weekday = WeekDay::FRIDAY();
-        self::assertSame('FRIDAY', (string) $weekday);
-    }
-
-    public function testName() : void
-    {
-        $this->assertSame('WEDNESDAY', WeekDay::WEDNESDAY()->name());
-    }
-
-    public function testOrdinal() : void
-    {
-        $this->assertSame(2, WeekDay::WEDNESDAY()->ordinal());
-    }
-
-    public function testSameInstanceIsReturned() : void
-    {
-        self::assertSame(WeekDay::FRIDAY(), WeekDay::FRIDAY());
-    }
-
-    public static function testValueOf() : void
-    {
-        self::assertSame(WeekDay::FRIDAY(), WeekDay::valueOf('FRIDAY'));
-    }
-
-    public function testValueOfInvalidConstant() : void
-    {
-        $this->expectException(IllegalArgumentException::class);
-        WeekDay::valueOf('CATURDAY');
-    }
-
-    public function testExceptionOnCloneAttempt() : void
-    {
-        $this->expectException(CloneNotSupportedException::class);
-        clone WeekDay::FRIDAY();
-    }
-
-    public function testExceptionOnSerializeAttempt() : void
-    {
-        $this->expectException(SerializeNotSupportedException::class);
-        serialize(WeekDay::FRIDAY());
-    }
-
-    public function testExceptionOnUnserializeAttempt() : void
-    {
-        $this->expectException(UnserializeNotSupportedException::class);
-        unserialize('O:24:"DASPRiD\\EnumTest\\WeekDay":0:{}');
-    }
-
-    public function testReturnValueOfValuesIsSortedByOrdinal() : void
-    {
-        // Initialize some week days out of order
-        WeekDay::SATURDAY();
-        WeekDay::TUESDAY();
-
-        $ordinals = array_values(array_map(function (WeekDay $weekDay) : int {
-            return $weekDay->ordinal();
-        }, WeekDay::values()));
-
-        self::assertSame([0, 1, 2, 3, 4, 5, 6], $ordinals);
-
-        $cachedOrdinals = array_values(array_map(function (WeekDay $weekDay) : int {
-            return $weekDay->ordinal();
-        }, WeekDay::values()));
-        $this->assertSame($ordinals, $cachedOrdinals);
-    }
-
-    public function testCompareTo() : void
-    {
-        $this->assertSame(-4, WeekDay::WEDNESDAY()->compareTo(WeekDay::SUNDAY()));
-        $this->assertSame(4, WeekDay::SUNDAY()->compareTo(WeekDay::WEDNESDAY()));
-        $this->assertSame(0, WeekDay::WEDNESDAY()->compareTo(WeekDay::WEDNESDAY()));
-    }
-
-    public function testCompareToWrongEnum() : void
-    {
-        $this->expectException(MismatchException::class);
-        WeekDay::MONDAY()->compareTo(Planet::EARTH());
-    }
-
-    public function testParameterizedEnum() : void
-    {
-        $planet = Planet::EARTH();
-        $this->assertSame(5.976e+24, $planet->mass());
-        $this->assertSame(6.37814e6, $planet->radius());
-    }
-}

+ 0 - 243
htdocs/includes/dasprid/enum/test/EnumMapTest.php

@@ -1,243 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace DASPRiD\EnumTest;
-
-use DASPRiD\Enum\EnumMap;
-use DASPRiD\Enum\Exception\ExpectationException;
-use DASPRiD\Enum\Exception\IllegalArgumentException;
-use PHPUnit\Framework\TestCase;
-use stdClass;
-
-final class EnumMapTest extends TestCase
-{
-    public function testConstructionWithInvalidEnumType() : void
-    {
-        $this->expectException(IllegalArgumentException::class);
-        new EnumMap(stdClass::class, 'string', false);
-    }
-
-    public function testUnexpectedKeyType() : void
-    {
-        $this->expectException(ExpectationException::class);
-        $map = new EnumMap(WeekDay::class, 'string', false);
-        $map->expect(Planet::class, 'string', false);
-    }
-
-    public function testUnexpectedValueType() : void
-    {
-        $this->expectException(ExpectationException::class);
-        $map = new EnumMap(WeekDay::class, 'string', false);
-        $map->expect(WeekDay::class, 'int', false);
-    }
-
-    public function testUnexpectedNullableValueType() : void
-    {
-        $this->expectException(ExpectationException::class);
-        $map = new EnumMap(WeekDay::class, 'string', true);
-        $map->expect(WeekDay::class, 'string', false);
-    }
-
-    public function testExpectedTypes() : void
-    {
-        $map = new EnumMap(WeekDay::class, 'string', true);
-        $map->expect(WeekDay::class, 'string', true);
-        $this->addToAssertionCount(1);
-    }
-
-    public function testSize() : void
-    {
-        $map = new EnumMap(WeekDay::class, 'string', true);
-        $this->assertSame(0, $map->size());
-        $map->put(WeekDay::MONDAY(), 'foo');
-        $this->assertSame(1, $map->size());
-    }
-
-    public function testContainsValue() : void
-    {
-        $map = new EnumMap(WeekDay::class, 'string', true);
-        $this->assertFalse($map->containsValue('foo'));
-        $map->put(WeekDay::TUESDAY(), 'foo');
-        $this->assertTrue($map->containsValue('foo'));
-        $this->assertFalse($map->containsValue(null));
-        $map->put(WeekDay::WEDNESDAY(), null);
-        $this->assertTrue($map->containsValue(null));
-    }
-
-    public function testContainsKey() : void
-    {
-        $map = new EnumMap(WeekDay::class, 'string', true);
-        $this->assertFalse($map->containsKey(WeekDay::TUESDAY()));
-        $map->put(WeekDay::TUESDAY(), 'foo');
-        $this->assertTrue($map->containsKey(WeekDay::TUESDAY()));
-        $map->put(WeekDay::WEDNESDAY(), null);
-        $this->assertTrue($map->containsKey(WeekDay::WEDNESDAY()));
-    }
-
-    public function testPutAndGet() : void
-    {
-        $map = new EnumMap(WeekDay::class, 'string', true);
-        $map->put(WeekDay::TUESDAY(), 'foo');
-        $map->put(WeekDay::FRIDAY(), null);
-        $this->assertSame('foo', $map->get(WeekDay::TUESDAY()));
-        $this->assertSame(null, $map->get(WeekDay::WEDNESDAY()));
-        $this->assertSame(null, $map->get(WeekDay::FRIDAY()));
-    }
-
-    public function testPutInvalidKey() : void
-    {
-        $this->expectException(IllegalArgumentException::class);
-        $map = new EnumMap(WeekDay::class, 'string', true);
-        $map->put(Planet::MARS(), 'foo');
-    }
-
-    public function invalidValues() : array
-    {
-        return [
-            ['bool', null, false],
-            ['bool', 0],
-            ['boolean', 0],
-            ['int', 2.4],
-            ['integer', 5.3],
-            ['float', 3],
-            ['double', 7],
-            ['string', 1],
-            ['object', 1],
-            ['array', 1],
-            [stdClass::class, 1],
-        ];
-    }
-
-    /**
-     * @dataProvider invalidValues
-     * @param mixed $value
-     */
-    public function testPutInvalidValue(string $valueType, $value, bool $allowNull = true) : void
-    {
-        $this->expectException(IllegalArgumentException::class);
-        $map = new EnumMap(WeekDay::class, $valueType, $allowNull);
-        $map->put(WeekDay::TUESDAY(), $value);
-    }
-
-    public function validValues() : array
-    {
-        return [
-            ['bool', null],
-            ['mixed', 'foo'],
-            ['mixed', 1],
-            ['mixed', new stdClass()],
-            ['bool', true],
-            ['boolean', false],
-            ['int', 1],
-            ['integer', 4],
-            ['float', 2.5],
-            ['double', 6.4],
-            ['string', 'foo'],
-            ['object', new stdClass()],
-            ['array', ['foo']],
-            [stdClass::class, new stdClass()],
-        ];
-    }
-
-    /**
-     * @dataProvider validValues
-     * @param mixed $value
-     */
-    public function testPutValidValue(string $valueType, $value, bool $allowNull = true) : void
-    {
-        $map = new EnumMap(WeekDay::class, $valueType, $allowNull);
-        $map->put(WeekDay::TUESDAY(), $value);
-        $this->addToAssertionCount(1);
-    }
-
-    public function testRemove() : void
-    {
-        $map = new EnumMap(WeekDay::class, 'string', true);
-        $map->put(WeekDay::TUESDAY(), 'foo');
-        $map->remove(WeekDay::TUESDAY());
-        $map->remove(WeekDay::WEDNESDAY());
-        $this->assertSame(null, $map->get(WeekDay::TUESDAY()));
-        $this->assertSame(0, $map->size());
-    }
-
-    public function testClear() : void
-    {
-        $map = new EnumMap(WeekDay::class, 'string', true);
-        $map->put(WeekDay::TUESDAY(), 'foo');
-        $map->clear();
-        $this->assertSame(null, $map->get(WeekDay::TUESDAY()));
-        $this->assertSame(0, $map->size());
-    }
-
-    public function testEqualsWithSameInstance() : void
-    {
-        $map = new EnumMap(WeekDay::class, 'string', true);
-        $this->assertTrue($map->equals($map));
-    }
-
-    public function testEqualsWithDifferentSize() : void
-    {
-        $mapA = new EnumMap(WeekDay::class, 'string', true);
-        $mapB = new EnumMap(WeekDay::class, 'string', true);
-        $mapB->put(WeekDay::MONDAY(), 'foo');
-
-        $this->assertFalse($mapA->equals($mapB));
-    }
-
-    public function testEqualsWithDifferentValues() : void
-    {
-        $mapA = new EnumMap(WeekDay::class, 'string', true);
-        $mapA->put(WeekDay::MONDAY(), 'foo');
-        $mapB = new EnumMap(WeekDay::class, 'string', true);
-        $mapB->put(WeekDay::MONDAY(), 'bar');
-
-        $this->assertFalse($mapA->equals($mapB));
-    }
-
-    public function testEqualsWithDifferentConstants() : void
-    {
-        $mapA = new EnumMap(WeekDay::class, 'string', true);
-        $mapA->put(WeekDay::MONDAY(), 'foo');
-        $mapB = new EnumMap(WeekDay::class, 'string', true);
-        $mapB->put(WeekDay::TUESDAY(), 'foo');
-
-        $this->assertFalse($mapA->equals($mapB));
-    }
-
-    public function testValues() : void
-    {
-        $map = new EnumMap(WeekDay::class, 'string', true);
-        $this->assertSame([], $map->values());
-
-        $map->put(WeekDay::FRIDAY(), 'foo');
-        $map->put(WeekDay::TUESDAY(), 'bar');
-        $map->put(WeekDay::SUNDAY(), null);
-
-        $this->assertSame(['bar', 'foo', null], $map->values());
-    }
-
-    public function testSerializeAndUnserialize() : void
-    {
-        $mapA = new EnumMap(WeekDay::class, 'string', true);
-        $mapA->put(WeekDay::MONDAY(), 'foo');
-        $mapB = unserialize(serialize($mapA));
-
-        $this->assertTrue($mapA->equals($mapB));
-    }
-
-    public function testIterator() : void
-    {
-        $map = new EnumMap(WeekDay::class, 'string', true);
-        $map->put(WeekDay::FRIDAY(), 'foo');
-        $map->put(WeekDay::TUESDAY(), 'bar');
-        $map->put(WeekDay::SUNDAY(), null);
-
-        $result = [];
-
-        foreach ($map as $key => $value) {
-            $result[$key->ordinal()] = $value;
-        }
-
-        $this->assertSame([1 => 'bar', 4 => 'foo', 6 => null], $result);
-    }
-}

+ 0 - 31
htdocs/includes/dasprid/enum/test/NullValueTest.php

@@ -1,31 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace DASPRiD\EnumTest;
-
-use DASPRiD\Enum\Exception\CloneNotSupportedException;
-use DASPRiD\Enum\Exception\SerializeNotSupportedException;
-use DASPRiD\Enum\Exception\UnserializeNotSupportedException;
-use DASPRiD\Enum\NullValue;
-use PHPUnit\Framework\TestCase;
-
-final class NullValueTest extends TestCase
-{
-    public function testExceptionOnCloneAttempt() : void
-    {
-        $this->expectException(CloneNotSupportedException::class);
-        clone NullValue::instance();
-    }
-
-    public function testExceptionOnSerializeAttempt() : void
-    {
-        $this->expectException(SerializeNotSupportedException::class);
-        serialize(NullValue::instance());
-    }
-
-    public function testExceptionOnUnserializeAttempt() : void
-    {
-        $this->expectException(UnserializeNotSupportedException::class);
-        unserialize('O:22:"DASPRiD\\Enum\\NullValue":0:{}');
-    }
-}

+ 0 - 73
htdocs/includes/dasprid/enum/test/Planet.php

@@ -1,73 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace DASPRiD\EnumTest;
-
-use DASPRiD\Enum\AbstractEnum;
-
-/**
- * @method static self MERCURY()
- * @method static self VENUS()
- * @method static self EARTH()
- * @method static self MARS()
- * @method static self JUPITER()
- * @method static self SATURN()
- * @method static self URANUS()
- * @method static self NEPTUNE()
- */
-final class Planet extends AbstractEnum
-{
-    protected const MERCURY = [3.303e+23, 2.4397e6];
-    protected const VENUS = [4.869e+24, 6.0518e6];
-    protected const EARTH = [5.976e+24, 6.37814e6];
-    protected const MARS = [6.421e+23, 3.3972e6];
-    protected const JUPITER = [1.9e+27, 7.1492e7];
-    protected const SATURN = [5.688e+26, 6.0268e7];
-    protected const URANUS = [8.686e+25, 2.5559e7];
-    protected const NEPTUNE = [1.024e+26, 2.4746e7];
-
-    /**
-     * Universal gravitational constant.
-     */
-    private const G = 6.67300E-11;
-
-    /**
-     * Mass in kilograms.
-     *
-     * @var float
-     */
-    private $mass;
-
-    /**
-     * Radius in meters.
-     *
-     * @var float
-     */
-    private $radius;
-
-    protected function __construct(float $mass, float $radius)
-    {
-        $this->mass = $mass;
-        $this->radius = $radius;
-    }
-
-    public function mass() : float
-    {
-        return $this->mass;
-    }
-
-    public function radius() : float
-    {
-        return $this->radius;
-    }
-
-    public function surfaceGravity() : float
-    {
-        return self::G * $this->mass / ($this->radius * $this->radius);
-    }
-
-    public function surfaceWeight(float $otherMass) : float
-    {
-        return $otherMass * $this->surfaceGravity();
-    }
-}

+ 0 - 26
htdocs/includes/dasprid/enum/test/WeekDay.php

@@ -1,26 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace DASPRiD\EnumTest;
-
-use DASPRiD\Enum\AbstractEnum;
-
-/**
- * @method static self MONDAY()
- * @method static self TUESDAY()
- * @method static self WEDNESDAY()
- * @method static self THURSDAY()
- * @method static self FRIDAY()
- * @method static self SATURDAY()
- * @method static self SUNDAY()
- */
-final class WeekDay extends AbstractEnum
-{
-    protected const MONDAY = null;
-    protected const TUESDAY = null;
-    protected const WEDNESDAY = null;
-    protected const THURSDAY = null;
-    protected const FRIDAY = null;
-    protected const SATURDAY = null;
-    protected const SUNDAY = null;
-}

+ 0 - 0
htdocs/includes/endroid/qr-code/composer.json → htdocs/includes/endroid/qr-code/composer.json.disabled


+ 0 - 0
htdocs/includes/kmukku/php-iso11649/composer.json → htdocs/includes/kmukku/php-iso11649/composer.json.disabled


+ 0 - 0
htdocs/includes/sprain/swiss-qr-bill/composer.json → htdocs/includes/sprain/swiss-qr-bill/composer.json.disabled


二进制
htdocs/includes/sprain/swiss-qr-bill/docs/assets/example-payment-part.png


文件差异内容过多而无法显示
+ 0 - 3552
htdocs/includes/sprain/swiss-qr-bill/docs/specs/ig-qr-bill-en-v2.2.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/docs/specs/qr-iid_qr-iban-en.pdf


文件差异内容过多而无法显示
+ 0 - 54
htdocs/includes/sprain/swiss-qr-bill/docs/specs/style-guide-en.pdf


+ 0 - 31
htdocs/includes/sprain/swiss-qr-bill/example/FpdfOutput/fpdf-example.php

@@ -1,31 +0,0 @@
-<?php declare(strict_types=1);
-
-use Sprain\SwissQrBill as QrBill;
-
-require __DIR__ . '/../../vendor/autoload.php';
-
-// 1. Let's load the base example to define the qr bill contents
-require __DIR__ . '/../example.php';
-
-// 2. Create an FPDF instance (or use an existing one from your project)
-// – alternatively, an instance of \setasign\Fpdi\Fpdi() is also accepted by FpdfOutput.
-$fpdf = new \Fpdf\Fpdf('P', 'mm', 'A4');
-
-// In case your server does not support "allow_url_fopen", use this way to create your FPDF instance:
-// $fpdf = new class('P', 'mm', 'A4') extends \Fpdf\Fpdf {
-//     use \Fpdf\Traits\MemoryImageSupport\MemImageTrait;
-// };
-
-$fpdf->AddPage();
-
-// 3. Create a full payment part for FPDF
-$output = new QrBill\PaymentPart\Output\FpdfOutput\FpdfOutput($qrBill, 'en', $fpdf);
-$output
-    ->setPrintable(false)
-    ->getPaymentPart();
-
-// 4. For demo purposes, let's save the generated example in a file
-$examplePath = __DIR__ . "/fpdf_example.pdf";
-$fpdf->Output($examplePath, 'F');
-
-print "PDF example created here : " . $examplePath;

+ 0 - 21
htdocs/includes/sprain/swiss-qr-bill/example/HtmlOutput/html-example.php

@@ -1,21 +0,0 @@
-<?php declare(strict_types=1);
-
-use Sprain\SwissQrBill as QrBill;
-
-require __DIR__ . '/../../vendor/autoload.php';
-
-// 1. Let's load the base example to define the qr bill contents
-require __DIR__ . '/../example.php';
-
-// 2. Create a full payment part in HTML
-$output = new QrBill\PaymentPart\Output\HtmlOutput\HtmlOutput($qrBill, 'en');
-
-$html = $output
-    ->setPrintable(false)
-    ->getPaymentPart();
-
-// 3. For demo purposes, let's save the generated example in a file
-$examplePath = __DIR__ . '/html-example.htm';
-file_put_contents($examplePath, $html);
-
-print 'HTML example created here: ' . $examplePath;

+ 0 - 27
htdocs/includes/sprain/swiss-qr-bill/example/TcPdfOutput/tcpdf-example.php

@@ -1,27 +0,0 @@
-<?php declare(strict_types=1);
-
-use Sprain\SwissQrBill as QrBill;
-
-require __DIR__ . '/../../vendor/autoload.php';
-
-// 1. Let's load the base example to define the qr bill contents
-require __DIR__ . '/../example.php';
-
-// 2. Create a TCPDF instance (or use an existing one from your project)
-// – alternatively, an instance of \setasign\Fpdi\Tcpdf\Fpdi() is also accepted by TcPdfOutput.
-$tcPdf = new TCPDF('P', 'mm', 'A4', true, 'ISO-8859-1');
-$tcPdf->setPrintHeader(false);
-$tcPdf->setPrintFooter(false);
-$tcPdf->AddPage();
-
-// 3. Create a full payment part for TcPDF
-$output = new QrBill\PaymentPart\Output\TcPdfOutput\TcPdfOutput($qrBill, 'en', $tcPdf);
-$output
-    ->setPrintable(false)
-    ->getPaymentPart();
-
-// 4. For demo purposes, let's save the generated example in a file
-$examplePath = __DIR__ . "/tcpdf_example.pdf";
-$tcPdf->Output($examplePath, 'F');
-
-print "PDF example created here : ".$examplePath;

+ 0 - 92
htdocs/includes/sprain/swiss-qr-bill/example/example.php

@@ -1,92 +0,0 @@
-<?php declare(strict_types=1);
-
-use Sprain\SwissQrBill as QrBill;
-
-require __DIR__ . '/../vendor/autoload.php';
-
-// This is an example how to create a typical qr bill:
-// - with reference number
-// - with known debtor
-// - with specified amount
-// - with human-readable additional information
-// - using your QR-IBAN
-//
-// Likely the most common use-case in the business world.
-
-// Create a new instance of QrBill, containing default headers with fixed values
-$qrBill = QrBill\QrBill::create();
-
-// Add creditor information
-// Who will receive the payment and to which bank account?
-$qrBill->setCreditor(
-    QrBill\DataGroup\Element\CombinedAddress::create(
-        'Robert Schneider AG',
-        'Rue du Lac 1268',
-        '2501 Biel',
-        'CH'
-    ));
-
-$qrBill->setCreditorInformation(
-    QrBill\DataGroup\Element\CreditorInformation::create(
-        'CH4431999123000889012' // This is a special QR-IBAN. Classic IBANs will not be valid here.
-    ));
-
-// Add debtor information
-// Who has to pay the invoice? This part is optional.
-//
-// Notice how you can use two different styles of addresses: CombinedAddress or StructuredAddress.
-// They are interchangeable for creditor as well as debtor.
-$qrBill->setUltimateDebtor(
-    QrBill\DataGroup\Element\StructuredAddress::createWithStreet(
-        'Pia-Maria Rutschmann-Schnyder',
-        'Grosse Marktgasse',
-        '28',
-        '9400',
-        'Rorschach',
-        'CH'
-    ));
-
-// Add payment amount information
-// What amount is to be paid?
-$qrBill->setPaymentAmountInformation(
-    QrBill\DataGroup\Element\PaymentAmountInformation::create(
-        'CHF',
-        2500.25
-    ));
-
-// Add payment reference
-// This is what you will need to identify incoming payments.
-$referenceNumber = QrBill\Reference\QrPaymentReferenceGenerator::generate(
-    '210000',  // You receive this number from your bank (BESR-ID). Unless your bank is PostFinance, in that case use NULL.
-    '313947143000901' // A number to match the payment with your internal data, e.g. an invoice number
-);
-
-$qrBill->setPaymentReference(
-    QrBill\DataGroup\Element\PaymentReference::create(
-        QrBill\DataGroup\Element\PaymentReference::TYPE_QR,
-        $referenceNumber
-    ));
-
-// Optionally, add some human-readable information about what the bill is for.
-$qrBill->setAdditionalInformation(
-    QrBill\DataGroup\Element\AdditionalInformation::create(
-        'Invoice 123456, Gardening work'
-    )
-);
-
-// Now get the QR code image and save it as a file.
-try {
-    $qrBill->getQrCode()->writeFile(__DIR__ . '/qr.png');
-    $qrBill->getQrCode()->writeFile(__DIR__ . '/qr.svg');
-} catch (Exception $e) {
-	foreach($qrBill->getViolations() as $violation) {
-		print $violation->getMessage()."\n";
-	}
-	exit;
-}
-
-// Next: Output full payment parts, depending on the format you want to use:
-//
-// - FpdfOutput/fpdf-example.php
-// - HtmlOutput/html-example.php
-// - TcPdfOutput/tcpdf-example.php

+ 0 - 61
htdocs/includes/sprain/swiss-qr-bill/example/example_minimal.php

@@ -1,61 +0,0 @@
-<?php declare(strict_types=1);
-
-use Sprain\SwissQrBill as QrBill;
-
-require __DIR__ . '/../vendor/autoload.php';
-
-// This is an example how to create a minimal qr bill:
-// - no defined amount
-// - no defined debtor
-// - no reference number
-
-// Create a new instance of QrBill, containing default headers with fixed values
-$qrBill = QrBill\QrBill::create();
-
-// Add creditor information
-// Who will receive the payment and to which bank account?
-$qrBill->setCreditor(
-    QrBill\DataGroup\Element\CombinedAddress::create(
-        'Robert Schneider AG',
-        'Rue du Lac 1268',
-        '2501 Biel',
-        'CH'
-    ));
-
-$qrBill->setCreditorInformation(
-    QrBill\DataGroup\Element\CreditorInformation::create(
-        'CH9300762011623852957' // This is a classic iban. QR-IBANs will not be valid in this minmal setup.
-    ));
-
-// Add payment amount information
-// The currency must be defined.
-$qrBill->setPaymentAmountInformation(
-    QrBill\DataGroup\Element\PaymentAmountInformation::create(
-        'CHF'
-    ));
-
-// Add payment reference
-// Explicitly define that no reference number will be used by setting TYPE_NON.
-$qrBill->setPaymentReference(
-    QrBill\DataGroup\Element\PaymentReference::create(
-        QrBill\DataGroup\Element\PaymentReference::TYPE_NON
-    ));
-
-// Time to output something!
-//
-// Get the QR code image  …
-try {
-    $qrBill->getQrCode()->writeFile(__DIR__ . '/qr.png');
-    $qrBill->getQrCode()->writeFile(__DIR__ . '/qr.svg');
-} catch (Exception $e) {
-	foreach($qrBill->getViolations() as $violation) {
-		print $violation->getMessage()."\n";
-	}
-	exit;
-}
-
-// Next: Output full payment parts, depending on the format you want to use:
-//
-// - FpdfOutput/fpdf-example.php
-// - HtmlOutput/html-example.php
-// - TcPdfOutput/tcpdf-example.php

+ 0 - 82
htdocs/includes/sprain/swiss-qr-bill/example/example_scor.php

@@ -1,82 +0,0 @@
-<?php declare(strict_types=1);
-
-use Sprain\SwissQrBill as QrBill;
-
-require __DIR__ . '/../vendor/autoload.php';
-
-// This is an example of how to create a qr bill with a reference in SCOR format instead of TYPE_QR.
-
-// Create a new instance of QrBill, containing default headers with fixed values
-$qrBill = QrBill\QrBill::create();
-
-// Add creditor information
-// Who will receive the payment and to which bank account?
-$qrBill->setCreditor(
-    QrBill\DataGroup\Element\CombinedAddress::create(
-        'Robert Schneider AG',
-        'Rue du Lac 1268',
-        '2501 Biel',
-        'CH'
-    ));
-
-$qrBill->setCreditorInformation(
-    QrBill\DataGroup\Element\CreditorInformation::create(
-        'CH9300762011623852957' // With SCOR, this is a classic iban. QR-IBANs will not be valid here.
-    ));
-
-// Add debtor information
-// Who has to pay the invoice? This part is optional.
-//
-// Notice how you can use two different styles of addresses: CombinedAddress or StructuredAddress.
-// They are interchangeable for creditor as well as debtor.
-$qrBill->setUltimateDebtor(
-    QrBill\DataGroup\Element\StructuredAddress::createWithStreet(
-        'Pia-Maria Rutschmann-Schnyder',
-        'Grosse Marktgasse',
-        '28',
-        '9400',
-        'Rorschach',
-        'CH'
-    ));
-
-// Add payment amount information
-// What amount is to be paid?
-$qrBill->setPaymentAmountInformation(
-    QrBill\DataGroup\Element\PaymentAmountInformation::create(
-        'CHF',
-        2500.25
-    ));
-
-// Add payment reference
-// This is what you will need to identify incoming payments.
-$qrBill->setPaymentReference(
-    QrBill\DataGroup\Element\PaymentReference::create(
-        QrBill\DataGroup\Element\PaymentReference::TYPE_SCOR,
-        QrBill\Reference\RfCreditorReferenceGenerator::generate('I20200631')
-    ));
-
-// Optionally, add some human-readable information about what the bill is for.
-$qrBill->setAdditionalInformation(
-    QrBill\DataGroup\Element\AdditionalInformation::create(
-        'Invoice 123456, Gardening work'
-    )
-);
-
-// Time to output something!
-//
-// Get the QR code image  …
-try {
-    $qrBill->getQrCode()->writeFile(__DIR__ . '/qr.png');
-    $qrBill->getQrCode()->writeFile(__DIR__ . '/qr.svg');
-} catch (Exception $e) {
-	foreach($qrBill->getViolations() as $violation) {
-		print $violation->getMessage()."\n";
-	}
-	exit;
-}
-
-// Next: Output full payment parts, depending on the format you want to use:
-//
-// - FpdfOutput/fpdf-example.php
-// - HtmlOutput/html-example.php
-// - TcPdfOutput/tcpdf-example.php

+ 0 - 72
htdocs/includes/sprain/swiss-qr-bill/example/example_zero_amount.php

@@ -1,72 +0,0 @@
-<?php declare(strict_types=1);
-
-use Sprain\SwissQrBill as QrBill;
-
-require __DIR__ . '/../vendor/autoload.php';
-
-// This is an example how to create a qr bill with an amount of 0.00 and
-// the note "do not use for payment". This is used for "Avisierungen".
-//
-// The specifics in this case are:
-// - set an amount of 0.00
-// - add the "do not use for payment" text as additional information. Translations are provided by this library.
-
-// Create a new instance of QrBill, containing default headers with fixed values
-$qrBill = QrBill\QrBill::create();
-
-// Add creditor information
-$qrBill->setCreditor(
-    QrBill\DataGroup\Element\CombinedAddress::create(
-        'Robert Schneider AG',
-        'Rue du Lac 1268',
-        '2501 Biel',
-        'CH'
-    ));
-
-$qrBill->setCreditorInformation(
-    QrBill\DataGroup\Element\CreditorInformation::create(
-        'CH4431999123000889012' // This is a special QR-IBAN. Classic IBANs will not be valid here.
-    ));
-
-// Add payment amount information of 0.00
-$qrBill->setPaymentAmountInformation(
-    QrBill\DataGroup\Element\PaymentAmountInformation::create(
-        'CHF',
-        0.00
-    ));
-
-// Add payment reference
-$referenceNumber = QrBill\Reference\QrPaymentReferenceGenerator::generate(
-    '210000',  // You receive this number from your bank (BESR-ID). Unless your bank is PostFinance, in that case use NULL.
-    '313947143000901' // A number to match the payment with your internal data, e.g. an invoice number
-);
-
-$qrBill->setPaymentReference(
-    QrBill\DataGroup\Element\PaymentReference::create(
-        QrBill\DataGroup\Element\PaymentReference::TYPE_QR,
-        $referenceNumber
-    ));
-
-// Add do-not-use-for-payment information
-$qrBill->setAdditionalInformation(
-    QrBill\DataGroup\Element\AdditionalInformation::create(
-        QrBill\PaymentPart\Translation\Translation::get('doNotUseForPayment', 'en')
-    )
-);
-
-// Now get the QR code image and save it as a file.
-try {
-    $qrBill->getQrCode()->writeFile(__DIR__ . '/qr.png');
-    $qrBill->getQrCode()->writeFile(__DIR__ . '/qr.svg');
-} catch (Exception $e) {
-    foreach($qrBill->getViolations() as $violation) {
-        print $violation->getMessage()."\n";
-    }
-    exit;
-}
-
-// Next: Output full payment parts, depending on the format you want to use:
-//
-// - FpdfOutput/fpdf-example.php
-// - HtmlOutput/html-example.php
-// - TcPdfOutput/tcpdf-example.php

+ 0 - 17
htdocs/includes/sprain/swiss-qr-bill/phpunit.xml.dist

@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit
-        bootstrap = "vendor/autoload.php"
-        colors = "true"
-        convertDeprecationsToExceptions = "false"
->
-    <php>
-        <env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
-    </php>
-
-    <testsuites>
-        <testsuite name="Swiss Qr Bill Test Suite">
-            <directory>tests</directory>
-        </testsuite>
-    </testsuites>
-</phpunit>

+ 0 - 157
htdocs/includes/sprain/swiss-qr-bill/tests/Constraints/ValidCreditorInformationPaymentReferenceCombinationTest.php

@@ -1,157 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\Constraints;
-
-use DG\BypassFinals;
-use Sprain\SwissQrBill\Constraint\ValidCreditorInformationPaymentReferenceCombination;
-use Sprain\SwissQrBill\Constraint\ValidCreditorInformationPaymentReferenceCombinationValidator;
-use Sprain\SwissQrBill\DataGroup\Element\CreditorInformation;
-use Sprain\SwissQrBill\DataGroup\Element\PaymentReference;
-use Sprain\SwissQrBill\QrBill;
-use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
-
-final class ValidCreditorInformationPaymentReferenceCombinationTest extends ConstraintValidatorTestCase
-{
-    protected function createValidator()
-    {
-        return new ValidCreditorInformationPaymentReferenceCombinationValidator();
-    }
-
-    public function testNullIsValid()
-    {
-        $this->validator->validate(null, new ValidCreditorInformationPaymentReferenceCombination());
-
-        $this->assertNoViolation();
-    }
-
-    public function testRandomClassIsValid()
-    {
-        $this->validator->validate(new \stdClass(), new ValidCreditorInformationPaymentReferenceCombination());
-
-        $this->assertNoViolation();
-    }
-
-    /**
-     * @dataProvider emptyQrBillMocksProvider
-     */
-    public function testEmptyQrBillValuesAreValid(QrBill $qrBillMock)
-    {
-        $this->validator->validate($qrBillMock, new ValidCreditorInformationPaymentReferenceCombination());
-
-        $this->assertNoViolation();
-    }
-
-    public function emptyQrBillMocksProvider(): array
-    {
-        BypassFinals::enable();
-
-        return [
-            [$this->getQrBillMock()],
-            [$this->getQrBillMock(
-                $this->getCreditorInformationMock(),
-                null
-            )],
-            [$this->getQrBillMock(
-                null,
-                $this->getPaymentReferenceMock()
-            )]
-        ];
-    }
-
-    /**
-     * @dataProvider validCombinationsQrBillMocksProvider
-     */
-    public function testValidCombinations(QrBill $qrBillMock)
-    {
-        $this->validator->validate($qrBillMock, new ValidCreditorInformationPaymentReferenceCombination());
-
-        $this->assertNoViolation();
-    }
-
-    public function validCombinationsQrBillMocksProvider(): array
-    {
-        return [
-            [$this->getQrBillMock(
-                $this->getCreditorInformationMock('any-iban', true),
-                $this->getPaymentReferenceMock(PaymentReference::TYPE_QR)
-            )],
-            [$this->getQrBillMock(
-                $this->getCreditorInformationMock('any-iban', false),
-                $this->getPaymentReferenceMock(PaymentReference::TYPE_SCOR)
-            )],
-            [$this->getQrBillMock(
-                $this->getCreditorInformationMock('any-iban', false),
-                $this->getPaymentReferenceMock(PaymentReference::TYPE_NON)
-            )],
-        ];
-    }
-
-    /**
-     * @dataProvider invalidCombinationsQrBillMocksProvider
-     */
-    public function testInvalidCombinations(QrBill $qrBillMock)
-    {
-        $this->validator->validate($qrBillMock, new ValidCreditorInformationPaymentReferenceCombination([
-            'message' => 'myMessage',
-        ]));
-
-        $this->buildViolation('myMessage')
-            ->setParameter('{{ referenceType }}', $qrBillMock->getPaymentReference()->getType())
-            ->setParameter('{{ iban }}', $qrBillMock->getCreditorInformation()->getIban())
-            ->assertRaised();
-    }
-
-    public function invalidCombinationsQrBillMocksProvider(): array
-    {
-        return [
-            [$this->getQrBillMock(
-                $this->getCreditorInformationMock('any-iban', false),
-                $this->getPaymentReferenceMock(PaymentReference::TYPE_QR)
-            )],
-            [$this->getQrBillMock(
-                $this->getCreditorInformationMock('any-iban', true),
-                $this->getPaymentReferenceMock(PaymentReference::TYPE_SCOR)
-            )],
-            [$this->getQrBillMock(
-                $this->getCreditorInformationMock('any-iban', true),
-                $this->getPaymentReferenceMock(PaymentReference::TYPE_NON)
-            )],
-        ];
-    }
-
-    public function getQrBillMock(?CreditorInformation $creditorInformation = null, ?PaymentReference $paymentReference = null)
-    {
-        $qrBill = $this->createMock(QrBill::class);
-
-        $qrBill->method('getCreditorInformation')
-            ->willReturn($creditorInformation);
-
-        $qrBill->method('getPaymentReference')
-            ->willReturn($paymentReference);
-
-        return $qrBill;
-    }
-
-    public function getCreditorInformationMock(string $iban = '', bool $containsQrIban = false)
-    {
-        $creditorInformation = $this->createMock(CreditorInformation::class);
-
-        $creditorInformation->method('getIban')
-            ->willReturn($iban);
-
-        $creditorInformation->method('containsQrIban')
-            ->willReturn($containsQrIban);
-
-        return $creditorInformation;
-    }
-
-    public function getPaymentReferenceMock(string $paymentReferenceType = '')
-    {
-        $paymentReference = $this->createMock(PaymentReference::class);
-
-        $paymentReference->method('getType')
-            ->willReturn($paymentReferenceType);
-
-        return $paymentReference;
-    }
-}

+ 0 - 71
htdocs/includes/sprain/swiss-qr-bill/tests/Constraints/ValidCreditorReferenceTest.php

@@ -1,71 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\Constraints;
-
-use Sprain\SwissQrBill\Constraint\ValidCreditorReference;
-use Sprain\SwissQrBill\Constraint\ValidCreditorReferenceValidator;
-use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
-
-final class ValidCreditorReferenceTest extends ConstraintValidatorTestCase
-{
-    protected function createValidator()
-    {
-        return new ValidCreditorReferenceValidator();
-    }
-
-    public function testNullIsValid()
-    {
-        $this->validator->validate(null, new ValidCreditorReference());
-
-        $this->assertNoViolation();
-    }
-
-    public function testEmptyStringIsValid()
-    {
-        $this->validator->validate('', new ValidCreditorReference());
-
-        $this->assertNoViolation();
-    }
-
-    /**
-     * @dataProvider getValidCreditorReferences
-     */
-    public function testValidCreditorReferences($value)
-    {
-        $this->validator->validate($value, new ValidCreditorReference());
-
-        $this->assertNoViolation();
-    }
-
-    public function getValidCreditorReferences()
-    {
-        return [
-            ['RF45 1234 5123 45'],
-            ['RF451234512345']
-        ];
-    }
-
-    /**
-     * @dataProvider getInvalidCreditorReferences
-     */
-    public function testInvalidCreditorReferences($creditorReference)
-    {
-        $this->validator->validate($creditorReference, new ValidCreditorReference([
-            'message' => 'myMessage',
-        ]));
-
-        $this->buildViolation('myMessage')
-            ->setParameter('{{ string }}', $creditorReference)
-            ->assertRaised();
-    }
-
-    public function getInvalidCreditorReferences()
-    {
-        return [
-            ['RF43 1234 5123 45'],
-            ['RF431234512345'],
-            ['RF431234512345Ä'],
-            ['foo']
-        ];
-    }
-}

+ 0 - 71
htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/AdditionalInformationTest.php

@@ -1,71 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\DataGroup\Element;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\DataGroup\Element\AdditionalInformation;
-
-final class AdditionalInformationTest extends TestCase
-{
-    /**
-     * @dataProvider messageProvider
-     */
-    public function testMessage(int $numberOfValidations, ?string $value): void
-    {
-        $additionalInformation = AdditionalInformation::create($value);
-
-        $this->assertSame($numberOfValidations, $additionalInformation->getViolations()->count());
-    }
-
-    public function messageProvider(): array
-    {
-        return [
-            [0, '012345678901234567890123456'],
-            [0, null],
-            [0, '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'],
-            [1, '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901'], // too long
-        ];
-    }
-
-    /**
-     * @dataProvider billInformationProvider
-     */
-    public function testBillInformation(int $numberOfValidations, ?string $value)
-    {
-        $additionalInformation = AdditionalInformation::create(null, $value);
-
-        $this->assertSame($numberOfValidations, $additionalInformation->getViolations()->count());
-    }
-
-    public function billInformationProvider(): array
-    {
-        return [
-            [0, '012345678901234567890123456'],
-            [0, null],
-            [0, '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'],
-            [1, '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901'], // too long
-        ];
-    }
-
-    public function testFormattedString(): void
-    {
-        $additionalInformation = AdditionalInformation::create('message');
-        $this->assertSame("message", $additionalInformation->getFormattedString());
-
-        $additionalInformation = AdditionalInformation::create('message', 'billInformation');
-        $this->assertSame("message\nbillInformation", $additionalInformation->getFormattedString());
-    }
-
-    public function testQrCodeData(): void
-    {
-        $additionalInformation = AdditionalInformation::create('message', 'billInformation');
-
-        $expected = [
-            'message',
-            AdditionalInformation::TRAILER_EPD,
-            'billInformation'
-        ];
-
-        $this->assertSame($expected, $additionalInformation->getQrCodeData());
-    }
-}

+ 0 - 35
htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/AlternativeSchemeTest.php

@@ -1,35 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\DataGroup\Element;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\DataGroup\Element\AlternativeScheme;
-
-final class AlternativeSchemeTest extends TestCase
-{
-    /**
-     * @dataProvider parameterProvider
-     */
-    public function testParameter(int $numberOfValidations, string $value): void
-    {
-        $alternativeScheme = AlternativeScheme::create($value);
-
-        $this->assertSame($numberOfValidations, $alternativeScheme->getViolations()->count());
-    }
-
-    public function parameterProvider(): array
-    {
-        return [
-            [0, '1'],
-            [0, 'foo'],
-            [0, '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'],
-
-            // examples as shown in https://www.paymentstandards.ch/dam/downloads/qrcodegenerator.java
-            [0, '1;1.1;1278564;1A-2F-43-AC-9B-33-21-B0-CC-D4-28-56;TCXVMKC22;2017-02-10T15:12:39;2017-02-10T15:18:16'],
-            [0, '2;2a-2.2r;_R1-CH2_ConradCH-2074-1_3350_2017-03-13T10:23:47_16,99_0,00_0,00_0,00_0,00_+8FADt/DQ=_1=='],
-
-            [1, ''],
-            [1, '12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901'] // too long
-        ];
-    }
-}

+ 0 - 317
htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/CombinedAddressTest.php

@@ -1,317 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\DataGroup\Element;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\DataGroup\Element\CombinedAddress;
-
-final class CombinedAddressTest extends TestCase
-{
-    /**
-     * @dataProvider nameProvider
-     */
-    public function testName($numberOfValidations, $value): void
-    {
-        $address = CombinedAddress::create(
-            $value,
-            'Musterweg 22a',
-            '1000 Lausanne',
-            'CH'
-        );
-
-        $this->assertSame($numberOfValidations, $address->getViolations()->count());
-    }
-
-    public function nameProvider(): array
-    {
-        return [
-            [0, 'A'],
-            [0, '123'],
-            [0, 'Müller AG'],
-            [0, 'Maria Bernasconi'],
-            [0, '70 chars, character limit abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr'],
-            [1, ''],
-            [1, '71 chars, above character limit abcdefghijklmnopqrstuvwxyzabcdefghijklm']
-        ];
-    }
-
-    /**
-     * @dataProvider addressLine1Provider
-     */
-    public function testAddressLine1(int $numberOfValidations, ?string $value): void
-    {
-        $address = CombinedAddress::create(
-            'Thomas Mustermann',
-            $value,
-            '1000 Lausanne',
-            'CH'
-        );
-
-        $this->assertSame($numberOfValidations, $address->getViolations()->count());
-    }
-
-    public function addressLine1Provider(): array
-    {
-        return [
-            [0, null],
-            [0, ''],
-            [0, 'A'],
-            [0, '123'],
-            [0, 'Sonnenweg'],
-            [0, '70 chars, character limit abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr'],
-            [1, '71 chars, above character limit abcdefghijklmnopqrstuvwxyzabcdefghijklm']
-        ];
-    }
-
-    /**
-     * @dataProvider addressLine2Provider
-     */
-    public function testAddressLine2(int $numberOfValidations, string $value): void
-    {
-        $address = CombinedAddress::create(
-            'Thomas Mustermann',
-            'Musterweg 22a',
-            $value,
-            'CH'
-        );
-
-        $this->assertSame($numberOfValidations, $address->getViolations()->count());
-    }
-
-    public function addressLine2Provider(): array
-    {
-        return [
-            [0, 'A'],
-            [0, '123'],
-            [0, 'Sonnenweg'],
-            [0, '70 chars, character limit abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr'],
-            [1, ''],
-            [1, '71 chars, above character limit abcdefghijklmnopqrstuvwxyzabcdefghijklm']
-        ];
-    }
-
-    public function testQrCodeData(): void
-    {
-        $address = CombinedAddress::create(
-            'Thomas Mustermann',
-            'Musterweg 22a',
-            '1000 Lausanne',
-            'CH'
-        );
-
-        $expected = [
-            'K',
-            'Thomas Mustermann',
-            'Musterweg 22a',
-            '1000 Lausanne',
-            '',
-            '',
-            'CH',
-        ];
-
-        $this->assertSame($expected, $address->getQrCodeData());
-    }
-
-    /**
-     * @dataProvider countryProvider
-     */
-    public function testCountry(int $numberOfValidations, string $value): void
-    {
-        $address = CombinedAddress::create(
-            'Thomas Mustermann',
-            'Musterweg 22a',
-            '1000 Lausanne',
-            $value
-        );
-
-        $this->assertSame($numberOfValidations, $address->getViolations()->count());
-    }
-
-    public function countryProvider(): array
-    {
-        return [
-            [0, 'CH'],
-            [0, 'ch'],
-            [0, 'DE'],
-            [0, 'LI'],
-            [0, 'US'],
-            [1, ''],
-            [1, 'XX'],
-            [1, 'SUI'],
-            [1, '12']
-        ];
-    }
-
-
-    /**
-     * @dataProvider addressProvider
-     */
-    public function testFullAddressString(CombinedAddress $address, string $expected): void
-    {
-        $this->assertSame($expected, $address->getFullAddress());
-    }
-
-    public function addressProvider(): array
-    {
-        return [
-            [
-                CombinedAddress::create(
-                    'Thomas Mustermann',
-                    'Musterweg 22a',
-                    '1000 Lausanne',
-                    'CH'
-                ),
-                "Thomas Mustermann\nMusterweg 22a\n1000 Lausanne"
-            ],
-            [
-                CombinedAddress::create(
-                    'Thomas Mustermann',
-                    null,
-                    '1000 Lausanne',
-                    'CH'
-                ),
-                "Thomas Mustermann\n1000 Lausanne"
-            ],
-            [
-                CombinedAddress::create(
-                    'Thomas Mustermann',
-                    'Musterweg 22a',
-                    '9490 Vaduz',
-                    'LI'
-                ),
-                "Thomas Mustermann\nMusterweg 22a\nLI-9490 Vaduz"
-            ],
-            [
-                CombinedAddress::create(
-                    'Thomas Mustermann',
-                    'Musterweg 22a',
-                    '80331 München',
-                    'DE'
-                ),
-                "Thomas Mustermann\nMusterweg 22a\nDE-80331 München"
-            ],
-            [
-                CombinedAddress::create(
-                    "Thomas\nMustermann",
-                    "Musterweg\t22a",
-                    "80331\r München",
-                    ' DE '
-                ),
-                "Thomas Mustermann\nMusterweg 22a\nDE-80331 München"
-            ],
-            [
-            CombinedAddress::create(
-                'Heaps of Characters International Trading Company of Switzerland GmbH',
-                'Street of the Mighty Long Names Where Heroes Live and Villans Die 75',
-                '1000 Lausanne au bord du lac, où le soleil brille encore la nuit',
-                'CH'
-            ),
-                "Heaps of Characters International Trading Company of Switzerland GmbH\nStreet of the Mighty Long Names Where Heroes Live and Villans Die 75\n1000 Lausanne au bord du lac, où le soleil brille encore la nuit"
-            ],
-            [
-                CombinedAddress::create(
-                    'Heaps of Characters International Trading Company of Switzerland GmbH',
-                    'Rue examplaire 22a',
-                    '1000 Lausanne',
-                    'CH'
-                ),
-                "Heaps of Characters International Trading Company of Switzerland GmbH\nRue examplaire 22a\n1000 Lausanne"
-            ],
-        ];
-    }
-
-    /**
-     * @dataProvider addressProviderReceipt
-     */
-    public function testFullAddressStringForReceipt(CombinedAddress $address, string $expected): void
-    {
-        $this->assertSame($expected, $address->getFullAddress(true));
-    }
-
-    public function addressProviderReceipt(): array
-    {
-        return [
-            [
-                CombinedAddress::create(
-                    'Thomas Mustermann',
-                    'Musterweg 22a',
-                    '1000 Lausanne',
-                    'CH'
-                ),
-                "Thomas Mustermann\nMusterweg 22a\n1000 Lausanne"
-            ],
-            [
-                CombinedAddress::create(
-                    'Thomas Mustermann',
-                    null,
-                    '1000 Lausanne',
-                    'CH'
-                ),
-                "Thomas Mustermann\n1000 Lausanne"
-            ],
-            [
-                CombinedAddress::create(
-                    'Thomas Mustermann',
-                    'Musterweg 22a',
-                    '9490 Vaduz',
-                    'LI'
-                ),
-                "Thomas Mustermann\nMusterweg 22a\nLI-9490 Vaduz"
-            ],
-            [
-                CombinedAddress::create(
-                    'Thomas Mustermann',
-                    'Musterweg 22a',
-                    '80331 München',
-                    'DE'
-                ),
-                "Thomas Mustermann\nMusterweg 22a\nDE-80331 München"
-            ],
-            [
-                CombinedAddress::create(
-                    "Thomas\nMustermann",
-                    "Musterweg\t22a",
-                    "80331\r München",
-                    ' DE '
-                ),
-                "Thomas Mustermann\nMusterweg 22a\nDE-80331 München"
-            ],
-            [
-                CombinedAddress::create(
-                    "Thomas\nMustermann",
-                    "Musterweg\t22a",
-                    "80331\r München",
-                    ' DE '
-                ),
-                "Thomas Mustermann\nMusterweg 22a\nDE-80331 München"
-            ],
-            [
-                CombinedAddress::create(
-                    "Thomas\nMustermann",
-                    "Musterweg\t22a",
-                    "80331\r München",
-                    ' DE '
-                ),
-                "Thomas Mustermann\nMusterweg 22a\nDE-80331 München"
-            ],
-            [
-                CombinedAddress::create(
-                    'Heaps of Characters International Trading Company of Switzerland GmbH',
-                    'Street of the Mighty Long Names Where Heroes Live and Villans Die 75',
-                    '1000 Lausanne au bord du lac, où le soleil brille encore la nuit',
-                    'CH'
-                ),
-                "Heaps of Characters International Trading Company of Switzerland GmbH"
-            ],
-            [
-                CombinedAddress::create(
-                    'Heaps of Characters International Trading Company of Switzerland GmbH',
-                    'Rue examplaire 22a',
-                    '1000 Lausanne',
-                    'CH'
-                ),
-                "Heaps of Characters International Trading Company of Switzerland GmbH\n1000 Lausanne"
-            ],
-        ];
-    }
-}

+ 0 - 113
htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/CreditorInformationTest.php

@@ -1,113 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\DataGroup\Element;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\DataGroup\Element\CreditorInformation;
-
-final class CreditorInformationTest extends TestCase
-{
-    /**
-     * @dataProvider ibanProvider
-     */
-    public function testIban(int $numberOfViolations, string $value)
-    {
-        $creditorInformation = CreditorInformation::create(
-            $value
-        );
-
-        $this->assertSame($numberOfViolations, $creditorInformation->getViolations()->count());
-    }
-
-    public function ibanProvider(): array
-    {
-        return [
-            [0, 'CH93 0076 2011 6238 5295 7'],
-            [0, 'CH9300762011623852957'],
-            [0, 'LI21 0881 0000 2324 013A A'],
-            [0, 'LI21088100002324013AA'],
-
-            // QR-IBANs
-            [0, 'CH44 3199 9123 0008 8901 2'],
-            [0, 'CH4431999123000889012'],
-
-            // missing number at end
-            [1, 'CH93 0076 2011 6238 5295'],
-            [1, 'CH930076201162385295'],
-            [1, 'LI21 0881 0000 2324 013A'],
-            [1, 'LI21088100002324013A'],
-
-            // missing letter in front
-            [2, 'H93 0076 2011 6238 5295'],
-            [2, 'H930076201162385295'],
-            [2, 'I21 0881 0000 2324 013A'],
-            [2, 'I21088100002324013A'],
-
-            // valid IBANs from unsupported countries
-            [1, 'AT61 1904 3002 3457 3201'],
-            [1, 'NO9386011117947'],
-
-            // random strings
-            [2, 'foo'],
-            [2, '123'],
-            [2, '*'],
-            [1, '']
-        ];
-    }
-
-    /**
-     * @dataProvider qrIbanCheckProvider
-     */
-    public function testContainsQrIban(bool $isQrIban, string $value): void
-    {
-        $creditorInformation = CreditorInformation::create(
-            $value
-        );
-
-        $this->assertSame($isQrIban, $creditorInformation->containsQrIban());
-    }
-
-    public function qrIbanCheckProvider(): array
-    {
-        return [
-            // normal valid IBANs
-            [false, 'CH9300762011623852957'],
-            [false, 'LI21088100002324013AA'],
-
-            // invalid or unsupported IBANs
-            [false, 'AT61 1904 3002 3457 3201'],
-            [false, ''],
-
-            // QR-IBANs
-            [true, 'CH44 3199 9123 0008 8901 2'],
-            [true, 'CH4431999123000889012'],
-        ];
-    }
-
-
-    /**
-     * @dataProvider formattedIbanProvider
-     */
-    public function testFormattedIban(string $iban, string $formattedIban): void
-    {
-        $creditorInformation = CreditorInformation::create(
-            $iban
-        );
-
-        $this->assertSame($formattedIban, $creditorInformation->getFormattedIban());
-    }
-
-    public function formattedIbanProvider(): array
-    {
-        return [
-            ['CH93 0076 2011 6238 5295 7', 'CH93 0076 2011 6238 5295 7'],
-            ['CH9300762011623852957', 'CH93 0076 2011 6238 5295 7'],
-            ['LI21 0881 0000 2324 013A A','LI21 0881 0000 2324 013A A'],
-            ['LI21088100002324013AA', 'LI21 0881 0000 2324 013A A'],
-
-            ['AAA', 'AAA'],
-            ['AAAA', 'AAAA'],
-            ['AAAAA', 'AAAA A']
-        ];
-    }
-}

+ 0 - 125
htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/HeaderTest.php

@@ -1,125 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\DataGroup\Element;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\DataGroup\Element\Header;
-
-final class HeaderTest extends TestCase
-{
-    /**
-     * @dataProvider qrTypeProvider
-     */
-    public function testQrType(int $numberOfViolations, string $value): void
-    {
-        $header = Header::create(
-            $value,
-            '0200',
-            1
-        );
-
-        $this->assertSame($numberOfViolations, $header->getViolations()->count());
-    }
-
-    public function qrTypeProvider(): array
-    {
-        return [
-            [0, 'SPC'],
-            [0, 'foo'],
-            [0, '123'],
-            [0, '000'],
-            [0, 'A1B'],
-            [0, '1AB'],
-            [0, 'AB1'],
-            [1, 'SP'],
-            [1, 'SPCC'],
-            [1, 'fo'],
-            [1, 'fooo'],
-            [1, '12'],
-            [1, '00'],
-            [1, 'SP*'],
-            [1, '*SP'],
-        ];
-    }
-
-    /**
-     * @dataProvider versionProvider
-     */
-    public function testVersionIsValid(int $numberOfViolations, string $value): void
-    {
-        $header = Header::create(
-            'SPC',
-            $value,
-            1
-        );
-
-        $this->assertSame($numberOfViolations, $header->getViolations()->count());
-    }
-
-    public function versionProvider(): array
-    {
-        return [
-            [0, '0200'],
-            [0, '1234'],
-            [0, '0000'],
-            [0, '9999'],
-            [1, '010'],
-            [1, '234'],
-            [1, 'ABCD'],
-            [1, 'abcd'],
-            [1, 'a1b2'],
-            [1, '1a2b'],
-            [1, '010*'],
-            [1, '*010']
-        ];
-    }
-
-    /**
-     * @dataProvider codingProvider
-     */
-    public function testCodingIsValid(int $numberOfViolations, int $value): void
-    {
-        $header = Header::create(
-            'SPC',
-            '0200',
-            $value
-        );
-
-        $this->assertSame($numberOfViolations, $header->getViolations()->count());
-    }
-
-    public function codingProvider()
-    {
-        return [
-            [0, 0],
-            [0, 1],
-            [0, 2],
-            [0, 3],
-            [0, 4],
-            [0, 5],
-            [0, 6],
-            [0, 7],
-            [0, 8],
-            [0, 9],
-            [1, 11],
-            [1, 222],
-        ];
-    }
-
-    public function testQrCodeData(): void
-    {
-        $header = Header::create(
-            'SPC',
-            '0200',
-            1
-        );
-
-        $expected = [
-            'SPC',
-            '0200',
-            1
-        ];
-
-        $this->assertSame($expected, $header->getQrCodeData());
-    }
-}

+ 0 - 103
htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/PaymentAmountInformationTest.php

@@ -1,103 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\DataGroup\Element;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\DataGroup\Element\PaymentAmountInformation;
-
-final class PaymentAmountInformationTest extends TestCase
-{
-    /**
-     * @dataProvider amountProvider
-     */
-    public function testAmount(int $numberOfViolations, ?float $value): void
-    {
-        $paymentAmountInformation = PaymentAmountInformation::create(
-            'CHF',
-            $value
-        );
-
-        $this->assertSame($numberOfViolations, $paymentAmountInformation->getViolations()->count());
-    }
-
-    public function amountProvider(): array
-    {
-        return [
-            [0, null],
-            [0, 0],
-            [0, 11.11],
-            [0, 100.2],
-            [0, 999999999.99],
-            [1, -0.01],
-            [1, 1999999999.99],
-            // [1, 11.111], @todo: only two decimal places should be allowed
-        ];
-    }
-
-    /**
-     * @dataProvider currencyProvider
-     */
-    public function testCurrency(int $numberOfViolations, string $value): void
-    {
-        $paymentAmountInformation = PaymentAmountInformation::create(
-            $value,
-            25
-        );
-
-        $this->assertSame($numberOfViolations, $paymentAmountInformation->getViolations()->count());
-    }
-
-    public function currencyProvider(): array
-    {
-        return [
-            [0, 'CHF'],
-            [0, 'EUR'],
-            [0, 'chf'],
-            [0, 'eur'],
-            [1, 'USD'],
-            [1, 'PLN'],
-            [1, ' chf '],
-            [1, ' EUR']
-        ];
-    }
-
-    /**
-     * @dataProvider formattedAmountProvider
-     */
-    public function testFormattedAmount(float $amount, string $formattedAmount)
-    {
-        $paymentAmountInformation = PaymentAmountInformation::create(
-            'CHF',
-            $amount
-        );
-
-        $this->assertSame($formattedAmount, $paymentAmountInformation->getFormattedAmount());
-    }
-
-    public function formattedAmountProvider(): array
-    {
-        return [
-            [0, '0.00'],
-            [25, '25.00'],
-            [1234.5, '1 234.50'],
-            [1234.55, '1 234.55'],
-            [12345.60, '12 345.60'],
-            [1234567, '1 234 567.00'],
-        ];
-    }
-
-    public function testQrCodeData(): void
-    {
-        $paymentAmountInformation = PaymentAmountInformation::create(
-            'CHF',
-            25
-        );
-
-        $expected = [
-            '25.00',
-            'CHF'
-        ];
-
-        $this->assertSame($expected, $paymentAmountInformation->getQrCodeData());
-    }
-}

+ 0 - 127
htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/PaymentReferenceTest.php

@@ -1,127 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\DataGroup\Element;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\DataGroup\Element\PaymentReference;
-
-final class PaymentReferenceTest extends TestCase
-{
-    /**
-     * @dataProvider qrReferenceProvider
-     */
-    public function testQrReference(int $numberOfViolations, ?string $value): void
-    {
-        $paymentReference = PaymentReference::create(
-            PaymentReference::TYPE_QR,
-            $value
-        );
-
-        $this->assertSame($numberOfViolations, $paymentReference->getViolations()->count());
-    }
-
-    public function qrReferenceProvider(): array
-    {
-        return [
-            [0, '012345678901234567890123456'],
-            [0, ' 01 23456 78901 23456 78901 23456 '],
-            [1, null],
-            [1, ''],
-            [1, ' '],
-            [1, '01234567890123456789012345'],   // too short
-            [1, '0123456789012345678901234567'], // too long
-            [1, 'Ä12345678901234567890123456']   // invalid characters
-        ];
-    }
-
-    /**
-     * @dataProvider scorReferenceProvider
-     */
-    public function testScorReference(int $numberOfViolations, ?string $value): void
-    {
-        $paymentReference = PaymentReference::create(
-            PaymentReference::TYPE_SCOR,
-            $value
-        );
-
-        $this->assertSame($numberOfViolations, $paymentReference->getViolations()->count());
-    }
-
-    public function scorReferenceProvider(): array
-    {
-        return [
-            [0, 'RF18539007547034'],
-            [0, ' RF18 5390 0754 7034 '],
-            [1, null],
-            [1, ''],
-            [1, ' '],
-            [1, 'RF12'],// too short
-            [1, 'RF181234567890123456789012'], // too long
-            [1, 'RF1853900754703Ä']  // invalid characters
-        ];
-    }
-
-    /**
-     * @dataProvider nonReferenceProvider
-     */
-    public function testNonReference(int $numberOfViolations, ?string $value): void
-    {
-        $paymentReference = PaymentReference::create(
-            PaymentReference::TYPE_NON,
-            $value
-        );
-
-        $this->assertSame($numberOfViolations, $paymentReference->getViolations()->count());
-    }
-
-    public function nonReferenceProvider()
-    {
-        return [
-            [0, null],
-            [0, ''],
-            [0, ' '],
-            [1, 'anything-non-empty']
-        ];
-    }
-
-    /**
-     * @dataProvider formattedReferenceProvider
-     */
-    public function testFormattedReference(string $type, ?string  $reference, ?string  $formattedReference): void
-    {
-        $paymentReference = PaymentReference::create(
-            $type,
-            $reference
-        );
-
-        $this->assertSame($formattedReference, $paymentReference->getFormattedReference());
-    }
-
-    public function formattedReferenceProvider(): array
-    {
-        return [
-            [PaymentReference::TYPE_QR, '012345678901234567890123456', '01 23456 78901 23456 78901 23456'],
-            [PaymentReference::TYPE_QR, ' 0123456789 0123456789 0123456 ', '01 23456 78901 23456 78901 23456'],
-            [PaymentReference::TYPE_SCOR, 'RF18539007547034', 'RF18 5390 0754 7034'],
-            [PaymentReference::TYPE_SCOR, ' R F1853900754703 4 ', 'RF18 5390 0754 7034'],
-            [PaymentReference::TYPE_NON, null, null],
-            [PaymentReference::TYPE_NON, '', null],
-            [PaymentReference::TYPE_NON, ' ', null],
-        ];
-    }
-
-    public function testQrCodeData(): void
-    {
-        $paymentReference = PaymentReference::create(
-            PaymentReference::TYPE_QR,
-            '012345678901234567890123456'
-        );
-
-        $expected = [
-            PaymentReference::TYPE_QR,
-            '012345678901234567890123456'
-        ];
-
-        $this->assertSame($expected, $paymentReference->getQrCodeData());
-    }
-}

+ 0 - 400
htdocs/includes/sprain/swiss-qr-bill/tests/DataGroup/Element/StructuredAddressTest.php

@@ -1,400 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\DataGroup\Element;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\DataGroup\Element\StructuredAddress;
-
-final class StructuredAddressTest extends TestCase
-{
-    /**
-     * @dataProvider nameProvider
-     */
-    public function testName($numberOfValidations, $value): void
-    {
-        $address = StructuredAddress::createWithoutStreet(
-            $value,
-            '1000',
-            'Lausanne',
-            'CH'
-        );
-
-        $this->assertSame($numberOfValidations, $address->getViolations()->count());
-    }
-
-    public function nameProvider(): array
-    {
-        return [
-            [0, 'A'],
-            [0, '123'],
-            [0, 'Müller AG'],
-            [0, 'Maria Bernasconi'],
-            [0, '70 chars, character limit abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr'],
-            [1, ''],
-            [1, '71 chars, above character limit abcdefghijklmnopqrstuvwxyzabcdefghijklm']
-        ];
-    }
-
-    /**
-     * @dataProvider streetProvider
-     */
-    public function testStreet(int $numberOfViolations, string $value): void
-    {
-        $address = StructuredAddress::createWithStreet(
-            'Thomas Mustermann',
-            $value,
-            '22a',
-            '1000',
-            'Lausanne',
-            'CH'
-        );
-
-        $this->assertSame($numberOfViolations, $address->getViolations()->count());
-    }
-
-    public function streetProvider(): array
-    {
-        return [
-            [0, ''],
-            [0, 'A'],
-            [0, '123'],
-            [0, 'Sonnenweg'],
-            [0, '70 chars, character limit abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr'],
-            [1, '71 chars, above character limit abcdefghijklmnopqrstuvwxyzabcdefghijklm'],
-        ];
-    }
-
-    /**
-     * @dataProvider buildingNumberProvider
-     */
-    public function testBuildingNumber(int $numberOfViolations, ?string $value): void
-    {
-        $address = StructuredAddress::createWithStreet(
-            'Thomas Mustermann',
-            'Musterweg',
-            $value,
-            '1000',
-            'Lausanne',
-            'CH'
-        );
-
-        $this->assertSame($numberOfViolations, $address->getViolations()->count());
-    }
-
-    public function buildingNumberProvider(): array
-    {
-        return [
-            [0, null],
-            [0, ''],
-            [0, '1'],
-            [0, '123'],
-            [0, '22a'],
-            [0, '16 chars, -limit'],
-            [1, '17 chars, ++limit']
-        ];
-    }
-
-    /**
-     * @dataProvider postalCodeProvider
-     */
-    public function testPostalCode(int $numberOfViolations, string $value): void
-    {
-        $address = StructuredAddress::createWithStreet(
-            'Thomas Mustermann',
-            'Musterweg',
-            '22a',
-            $value,
-            'Lausanne',
-            'CH'
-        );
-
-        $this->assertSame($numberOfViolations, $address->getViolations()->count());
-    }
-
-    public function postalCodeProvider(): array
-    {
-        return [
-            [0, '1'],
-            [0, '123'],
-            [0, '22a'],
-            [0, '16 chars, -limit'],
-            [1, ''],
-            [1, '17 chars, ++limit']
-        ];
-    }
-
-    /**
-     * @dataProvider cityProvider
-     */
-    public function testCity(int $numberOfViolations, string $value)
-    {
-        $address = StructuredAddress::createWithStreet(
-            'Thomas Mustermann',
-            'Musterweg',
-            '22a',
-            '1000',
-            $value,
-            'CH'
-        );
-
-        $this->assertSame($numberOfViolations, $address->getViolations()->count());
-    }
-
-    public function cityProvider(): array
-    {
-        return [
-            [0, 'A'],
-            [0, 'Zürich'],
-            [0, '35 chars, character limit abcdefghi'],
-            [1, ''],
-            [1, '36 chars, above character limit abcd']
-        ];
-    }
-
-    /**
-     * @dataProvider countryProvider
-     */
-    public function testCountry($numberOfValidations, $value): void
-    {
-        $address = StructuredAddress::createWithoutStreet(
-            'Thomas Mustermann',
-            '1000',
-            'Lausanne',
-            $value
-        );
-
-        $this->assertSame($numberOfValidations, $address->getViolations()->count());
-    }
-
-    public function countryProvider(): array
-    {
-        return [
-            [0, 'CH'],
-            [0, 'ch'],
-            [0, 'DE'],
-            [0, 'LI'],
-            [0, 'US'],
-            [1, ''],
-            [1, 'XX'],
-            [1, 'SUI'],
-            [1, '12']
-        ];
-    }
-
-    public function testQrCodeData()
-    {
-        $address = StructuredAddress::createWithStreet(
-            'Thomas Mustermann',
-            'Musterweg',
-            '22a',
-            '1000',
-            'Lausanne',
-            'CH'
-        );
-
-        $expected = [
-            'S',
-            'Thomas Mustermann',
-            'Musterweg',
-            '22a',
-            '1000',
-            'Lausanne',
-            'CH',
-        ];
-
-        $this->assertSame($expected, $address->getQrCodeData());
-    }
-
-    /**
-     * @dataProvider addressProvider
-     */
-    public function testFullAddressString(StructuredAddress $address, $expected): void
-    {
-        $this->assertSame($expected, $address->getFullAddress());
-    }
-
-    public function addressProvider(): array
-    {
-        return [
-            [
-                StructuredAddress::createWithStreet(
-                    'Thomas Mustermann',
-                    'Musterweg',
-                    '22a',
-                    '1000',
-                    'Lausanne',
-                    'CH'
-                ),
-                "Thomas Mustermann\nMusterweg 22a\n1000 Lausanne"
-            ],
-            [
-                StructuredAddress::createWithStreet(
-                    'Thomas Mustermann',
-                    'Musterweg',
-                    null,
-                    '1000',
-                    'Lausanne',
-                    'CH'
-                ),
-                "Thomas Mustermann\nMusterweg\n1000 Lausanne"
-            ],
-            [
-                StructuredAddress::createWithoutStreet(
-                    'Thomas Mustermann',
-                    '1000',
-                    'Lausanne',
-                    'CH'
-                ),
-                "Thomas Mustermann\n1000 Lausanne"
-            ],
-            [
-                StructuredAddress::createWithoutStreet(
-                    'Thomas Mustermann',
-                    '9490',
-                    'Vaduz',
-                    'LI'
-                ),
-                "Thomas Mustermann\nLI-9490 Vaduz"
-            ],
-            [
-                StructuredAddress::createWithoutStreet(
-                    'Thomas Mustermann',
-                    '80331',
-                    'München',
-                    'DE'
-                ),
-                "Thomas Mustermann\nDE-80331 München"
-            ],
-            [
-                StructuredAddress::createWithStreet(
-                    "Thomas\nMustermann",
-                    "Musterweg\t\ram\rRhein",
-                    '12',
-                    '80331',
-                    'München',
-                    ' DE '
-                ),
-                "Thomas Mustermann\nMusterweg am Rhein 12\nDE-80331 München"
-            ],
-            [
-                StructuredAddress::createWithStreet(
-                    'Heaps of Characters International Trading Company of Switzerland GmbH',
-                    'Street of the Mighty Long Names Where Heroes Live and Villans Die',
-                    '75',
-                    '1000',
-                    'Lausanne au bord du lac, où le soleil brille encore la nuit',
-                    'CH'
-                ),
-                "Heaps of Characters International Trading Company of Switzerland GmbH\nStreet of the Mighty Long Names Where Heroes Live and Villans Die 75\n1000 Lausanne au bord du lac, où le soleil brille encore la nuit"
-            ],
-            [
-                StructuredAddress::createWithStreet(
-                    'Heaps of Characters International Trading Company of Switzerland GmbH',
-                    'Rue examplaire',
-        '22a',
-                    '1000',
-                    'Lausanne',
-                    'CH'
-                ),
-                "Heaps of Characters International Trading Company of Switzerland GmbH\nRue examplaire 22a\n1000 Lausanne"
-            ],
-
-        ];
-    }
-
-    /**
-     * @dataProvider addressProviderReceipt
-     */
-    public function testFullAddressStringForReceipt(StructuredAddress $address, $expected): void
-    {
-        $this->assertSame($expected, $address->getFullAddress(true));
-    }
-
-    public function addressProviderReceipt(): array
-    {
-        return [
-            [
-                StructuredAddress::createWithStreet(
-                    'Thomas Mustermann',
-                    'Musterweg',
-                    '22a',
-                    '1000',
-                    'Lausanne',
-                    'CH'
-                ),
-                "Thomas Mustermann\nMusterweg 22a\n1000 Lausanne"
-            ],
-            [
-                StructuredAddress::createWithStreet(
-                    'Thomas Mustermann',
-                    'Musterweg',
-                    null,
-                    '1000',
-                    'Lausanne',
-                    'CH'
-                ),
-                "Thomas Mustermann\nMusterweg\n1000 Lausanne"
-            ],
-            [
-                StructuredAddress::createWithoutStreet(
-                    'Thomas Mustermann',
-                    '1000',
-                    'Lausanne',
-                    'CH'
-                ),
-                "Thomas Mustermann\n1000 Lausanne"
-            ],
-            [
-                StructuredAddress::createWithoutStreet(
-                    'Thomas Mustermann',
-                    '9490',
-                    'Vaduz',
-                    'LI'
-                ),
-                "Thomas Mustermann\nLI-9490 Vaduz"
-            ],
-            [
-                StructuredAddress::createWithoutStreet(
-                    'Thomas Mustermann',
-                    '80331',
-                    'München',
-                    'DE'
-                ),
-                "Thomas Mustermann\nDE-80331 München"
-            ],
-            [
-                StructuredAddress::createWithStreet(
-                    "Thomas\nMustermann",
-                    "Musterweg\t\ram\rRhein",
-                    '12',
-                    '80331',
-                    'München',
-                    ' DE '
-                ),
-                "Thomas Mustermann\nMusterweg am Rhein 12\nDE-80331 München"
-            ],
-            [
-                StructuredAddress::createWithStreet(
-                    'Heaps of Characters International Trading Company of Switzerland GmbH',
-                    'Street of the Mighty Long Names Where Heroes Live and Villans Die',
-                    '75',
-                    '1000',
-                    'Lausanne au bord du lac, où le soleil brille encore la nuit',
-                    'CH'
-                ),
-                "Heaps of Characters International Trading Company of Switzerland GmbH"
-            ],
-            [
-                StructuredAddress::createWithStreet(
-                    'Heaps of Characters International Trading Company of Switzerland GmbH',
-                    'Rue examplaire',
-                    '22a',
-                    '1000',
-                    'Lausanne',
-                    'CH'
-                ),
-                "Heaps of Characters International Trading Company of Switzerland GmbH\n1000 Lausanne"
-            ],
-        ];
-    }
-}

+ 0 - 132
htdocs/includes/sprain/swiss-qr-bill/tests/PaymentPart/Output/FpdfOutput/FpdfOutputTest.php

@@ -1,132 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\PaymentPart\Output\FpdfOutput;
-
-use Fpdf\Fpdf;
-use Fpdf\Traits\MemoryImageSupport\MemImageTrait;
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\Exception\InvalidFpdfImageFormat;
-use Sprain\SwissQrBill\PaymentPart\Output\FpdfOutput\FpdfOutput;
-use Sprain\SwissQrBill\PaymentPart\Output\FpdfOutput\UnsupportedEnvironmentException;
-use Sprain\SwissQrBill\QrBill;
-use Sprain\SwissQrBill\QrCode\QrCode;
-use Sprain\Tests\SwissQrBill\TestQrBillCreatorTrait;
-
-final class FpdfOutputTest extends TestCase
-{
-    use TestQrBillCreatorTrait;
-
-    /**
-     * @dataProvider validQrBillsProvider
-     */
-    public function testValidQrBills(string $name, QrBill $qrBill): void
-    {
-        $variations = [
-            [
-                'printable' => false,
-                'format' => QrCode::FILE_FORMAT_PNG,
-                'file' => dirname(dirname(dirname(__DIR__))) . '/TestData/FpdfOutput/' . $name . '.pdf'
-            ],
-            [
-                'printable' => true,
-                'format' => QrCode::FILE_FORMAT_PNG,
-                'file' => dirname(dirname(dirname(__DIR__))) . '/TestData/FpdfOutput/' . $name . '.print.pdf'
-            ]
-        ];
-
-        foreach ($variations as $variation) {
-            $file = $variation['file'];
-
-            $fpdf = $this->instantiateFpdf();
-            $fpdf->AddPage();
-
-            $output = new FpdfOutput($qrBill, 'en', $fpdf);
-            $output
-                ->setPrintable($variation['printable'])
-                ->setQrCodeImageFormat($variation['format'])
-                ->getPaymentPart();
-
-            if ($this->regenerateReferenceFiles) {
-                $fpdf->Output($file, 'F');
-            }
-            
-            $contents = $this->getActualPdfContents($fpdf->Output($file, 'S'));
-
-            $this->assertNotNull($contents);
-            $this->assertSame($this->getActualPdfContents(file_get_contents($file)), $contents);
-        }
-    }
-
-    public function testItThrowsSvgNotSupportedException(): void
-    {
-        $this->expectException(InvalidFpdfImageFormat::class);
-
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'creditor',
-            'paymentAmountInformation',
-            'paymentReferenceQr'
-        ]);
-
-        $fpdf = $this->instantiateFpdf();
-        $fpdf->AddPage();
-
-        $output = new FpdfOutput($qrBill, 'en', $fpdf);
-        $output
-            ->setQrCodeImageFormat(QrCode::FILE_FORMAT_SVG)
-            ->getPaymentPart();
-    }
-
-    public function testItThrowsUnsupportedEnvironmentException(): void
-    {
-        if ((bool)ini_get('allow_url_fopen')) {
-            $this->markTestSkipped("This test only works in hardened environment.");
-        }
-
-        $this->expectException(UnsupportedEnvironmentException::class);
-
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'creditor',
-            'paymentAmountInformation',
-            'paymentReferenceQr'
-        ]);
-
-        $fpdf = $this->instantiateFpdf(false);
-        $fpdf->AddPage();
-
-        $output = new FpdfOutput($qrBill, 'en', $fpdf);
-        $output
-            ->setQrCodeImageFormat(QrCode::FILE_FORMAT_PNG)
-            ->getPaymentPart();
-    }
-
-    private function getActualPdfContents(string $fileContents): ?string
-    {
-        // Extract actual pdf content and ignore all meta data which may differ in different versions of Fpdf
-        $pattern = '/stream(.*?)endstream/s';
-        preg_match($pattern, $fileContents, $matches);
-
-        if (isset($matches[1])) {
-            return $matches[1];
-        }
-        return null;
-    }
-
-    private function instantiateFpdf($withMemImageSupport = null): Fpdf
-    {
-        if ($withMemImageSupport === null) {
-            $withMemImageSupport = !ini_get('allow_url_fopen');
-        }
-
-        if ($withMemImageSupport) {
-            return new class('P', 'mm', 'A4') extends Fpdf {
-                use MemImageTrait;
-            };
-        }
-
-        return new Fpdf('P', 'mm', 'A4');
-    }
-}

+ 0 - 106
htdocs/includes/sprain/swiss-qr-bill/tests/PaymentPart/Output/FpdfOutput/FpdiOutputTest.php

@@ -1,106 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\PaymentPart\Output\FpdfOutput;
-
-use Fpdf\Traits\MemoryImageSupport\MemImageTrait;
-use PHPUnit\Framework\TestCase;
-use setasign\Fpdi\Fpdi;
-use Sprain\SwissQrBill\Exception\InvalidFpdfImageFormat;
-use Sprain\SwissQrBill\PaymentPart\Output\FpdfOutput\FpdfOutput;
-use Sprain\SwissQrBill\QrBill;
-use Sprain\SwissQrBill\QrCode\QrCode;
-use Sprain\Tests\SwissQrBill\TestQrBillCreatorTrait;
-
-final class FpdiOutputTest extends TestCase
-{
-    use TestQrBillCreatorTrait;
-
-    /**
-     * @dataProvider validQrBillsProvider
-     */
-    public function testValidQrBills(string $name, QrBill $qrBill): void
-    {
-        $variations = [
-            [
-                'printable' => false,
-                'format' => QrCode::FILE_FORMAT_PNG,
-                'file' => dirname(dirname(dirname(__DIR__))) . '/TestData/FpdfOutput/' . $name . '.pdf'
-            ],
-            [
-                'printable' => true,
-                'format' => QrCode::FILE_FORMAT_PNG,
-                'file' => dirname(dirname(dirname(__DIR__))) . '/TestData/FpdfOutput/' . $name . '.print.pdf'
-            ]
-        ];
-
-        foreach ($variations as $variation) {
-            $file = $variation['file'];
-
-            $fpdf = $this->instantiateFpdi();
-            $fpdf->AddPage();
-
-            $output = new FpdfOutput($qrBill, 'en', $fpdf);
-            $output
-                ->setPrintable($variation['printable'])
-                ->setQrCodeImageFormat($variation['format'])
-                ->getPaymentPart();
-
-            if ($this->regenerateReferenceFiles) {
-                $fpdf->Output($file, 'F');
-            }
-            
-            $contents = $this->getActualPdfContents($fpdf->Output($file, 'S'));
-
-            $this->assertNotNull($contents);
-            $this->assertSame($this->getActualPdfContents(file_get_contents($file)), $contents);
-        }
-    }
-
-    public function testItThrowsSvgNotSupportedException(): void
-    {
-        $this->expectException(InvalidFpdfImageFormat::class);
-
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'creditor',
-            'paymentAmountInformation',
-            'paymentReferenceQr'
-        ]);
-
-        $fpdf = $this->instantiateFpdi();
-        $fpdf->AddPage();
-
-        $output = new FpdfOutput($qrBill, 'en', $fpdf);
-        $output
-            ->setQrCodeImageFormat(QrCode::FILE_FORMAT_SVG)
-            ->getPaymentPart();
-    }
-
-    private function getActualPdfContents(string $fileContents): ?string
-    {
-        // Extract actual pdf content and ignore all meta data which may differ in different versions of Fpdf
-        $pattern = '/stream(.*?)endstream/s';
-        preg_match($pattern, $fileContents, $matches);
-
-        if (isset($matches[1])) {
-            return $matches[1];
-        }
-        return null;
-    }
-
-    private function instantiateFpdi($withMemImageSupport = null): Fpdi
-    {
-        if ($withMemImageSupport === null) {
-            $withMemImageSupport = !ini_get('allow_url_fopen');
-        }
-
-        if ($withMemImageSupport) {
-            return new class('P', 'mm', 'A4') extends Fpdi {
-                use MemImageTrait;
-            };
-        }
-
-        return new Fpdi('P', 'mm', 'A4');
-    }
-}

+ 0 - 64
htdocs/includes/sprain/swiss-qr-bill/tests/PaymentPart/Output/HtmlOutput/HtmlOutputTest.php

@@ -1,64 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\PaymentPart\Output\HtmlOutput;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\PaymentPart\Output\HtmlOutput\HtmlOutput;
-use Sprain\SwissQrBill\QrBill;
-use Sprain\SwissQrBill\QrCode\QrCode;
-use Sprain\Tests\SwissQrBill\TestQrBillCreatorTrait;
-
-final class HtmlOutputTest extends TestCase
-{
-    use TestQrBillCreatorTrait;
-
-    /**
-     * @dataProvider validQrBillsProvider
-     */
-    public function testValidQrBills(string $name, QrBill $qrBill)
-    {
-        $variations = [
-            [
-                'printable' => false,
-                'format' => QrCode::FILE_FORMAT_SVG,
-                'file' => __DIR__ . '/../../../TestData/HtmlOutput/' . $name . '.svg.html'
-            ],
-            [
-                'printable' => true,
-                'format' => QrCode::FILE_FORMAT_SVG,
-                'file' => __DIR__ . '/../../../TestData/HtmlOutput/' . $name . '.svg.print.html'
-            ],
-            /* PNGs do not create the same output in all environments
-            [
-                'printable' => false,
-                'format' => QrCode::FILE_FORMAT_PNG,
-                'file' => __DIR__ . '/../../../TestData/HtmlOutput/' . $name . '.png.html'
-            ],
-            [
-                'printable' => true,
-                'format' => QrCode::FILE_FORMAT_PNG,
-                'file' => __DIR__ . '/../../../TestData/HtmlOutput/' . $name . '.png.print.html'
-            ]
-            */
-        ];
-
-        foreach ($variations as $variation) {
-            $file = $variation['file'];
-
-            $htmlOutput = (new HtmlOutput($qrBill, 'en'));
-            $output = $htmlOutput
-                ->setPrintable($variation['printable'])
-                ->setQrCodeImageFormat($variation['format'])
-                ->getPaymentPart();
-
-            if ($this->regenerateReferenceFiles) {
-               file_put_contents($file, $output);
-            }
-
-            $this->assertSame(
-                file_get_contents($file),
-                $output
-            );
-        }
-    }
-}

+ 0 - 83
htdocs/includes/sprain/swiss-qr-bill/tests/PaymentPart/Output/TcPdfOutput/FpdiOutputTest.php

@@ -1,83 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\PaymentPart\Output\TcPdfOutput;
-
-use PHPUnit\Framework\TestCase;
-use setasign\Fpdi\Tcpdf\Fpdi;
-use Sprain\SwissQrBill\PaymentPart\Output\TcPdfOutput\TcPdfOutput;
-use Sprain\SwissQrBill\QrBill;
-use Sprain\SwissQrBill\QrCode\QrCode;
-use Sprain\Tests\SwissQrBill\TestQrBillCreatorTrait;
-
-final class FpdiOutputTest extends TestCase
-{
-    use TestQrBillCreatorTrait;
-
-    /**
-     * @dataProvider validQrBillsProvider
-     */
-    public function testValidQrBills(string $name, QrBill $qrBill): void
-    {
-        $variations = [
-            [
-                'printable' => false,
-                'format' => QrCode::FILE_FORMAT_SVG,
-                'file' => __DIR__ . '/../../../TestData/TcPdfOutput/' . $name . '.svg.pdf'
-            ],
-            [
-                'printable' => true,
-                'format' => QrCode::FILE_FORMAT_SVG,
-                'file' => __DIR__ . '/../../../TestData/TcPdfOutput/' . $name . '.svg.print.pdf'
-            ],
-            /* PNGs do not create the same output in all environments
-            [
-                'printable' => false,
-                'format' => QrCode::FILE_FORMAT_PNG,
-                'file' => __DIR__ . '/../../../TestData/TcPdfOutput/' . $name . '.png.pdf'
-            ],
-            [
-                'printable' => true,
-                'format' => QrCode::FILE_FORMAT_PNG,
-                'file' => __DIR__ . '/../../../TestData/TcPdfOutput/' . $name . '.png.print.pdf'
-            ]
-            */
-        ];
-
-        foreach ($variations as $variation) {
-            $file = $variation['file'];
-
-            $tcPdf = new Fpdi('P', 'mm', 'A4', true, 'ISO-8859-1');
-            $tcPdf->setPrintHeader(false);
-            $tcPdf->setPrintFooter(false);
-            $tcPdf->AddPage();
-
-            $output = (new TcPdfOutput($qrBill, 'en', $tcPdf));
-            $output
-                ->setPrintable($variation['printable'])
-                ->setQrCodeImageFormat($variation['format'])
-                ->getPaymentPart();
-
-            if ($this->regenerateReferenceFiles) {
-                $tcPdf->Output($file, 'F');
-            }
-
-            $contents = $this->getActualPdfContents($tcPdf->Output($file, 'S'));
-
-            $this->assertNotNull($contents);
-            $this->assertSame($this->getActualPdfContents(file_get_contents($file)), $contents);
-        }
-    }
-
-    private function getActualPdfContents(string $fileContents): ?string
-    {
-        // Extract actual pdf content and ignore all meta data which may differ in different versions of TcPdf
-        $pattern = '/stream(.*?)endstream/s';
-        preg_match($pattern, $fileContents, $matches);
-
-        if (isset($matches[1])) {
-            return $matches[1];
-        }
-
-        return null;
-    }
-}

+ 0 - 82
htdocs/includes/sprain/swiss-qr-bill/tests/PaymentPart/Output/TcPdfOutput/TcPdfOutputTest.php

@@ -1,82 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\PaymentPart\Output\TcPdfOutput;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\PaymentPart\Output\TcPdfOutput\TcPdfOutput;
-use Sprain\SwissQrBill\QrBill;
-use Sprain\SwissQrBill\QrCode\QrCode;
-use Sprain\Tests\SwissQrBill\TestQrBillCreatorTrait;
-
-final class TcPdfOutputTest extends TestCase
-{
-    use TestQrBillCreatorTrait;
-
-    /**
-     * @dataProvider validQrBillsProvider
-     */
-    public function testValidQrBills(string $name, QrBill $qrBill): void
-    {
-        $variations = [
-            [
-                'printable' => false,
-                'format' => QrCode::FILE_FORMAT_SVG,
-                'file' => __DIR__ . '/../../../TestData/TcPdfOutput/' . $name . '.svg.pdf'
-            ],
-            [
-                'printable' => true,
-                'format' => QrCode::FILE_FORMAT_SVG,
-                'file' => __DIR__ . '/../../../TestData/TcPdfOutput/' . $name . '.svg.print.pdf'
-            ],
-            /* PNGs do not create the same output in all environments
-            [
-                'printable' => false,
-                'format' => QrCode::FILE_FORMAT_PNG,
-                'file' => __DIR__ . '/../../../TestData/TcPdfOutput/' . $name . '.png.pdf'
-            ],
-            [
-                'printable' => true,
-                'format' => QrCode::FILE_FORMAT_PNG,
-                'file' => __DIR__ . '/../../../TestData/TcPdfOutput/' . $name . '.png.print.pdf'
-            ]
-            */
-        ];
-
-        foreach ($variations as $variation) {
-            $file = $variation['file'];
-
-            $tcPdf = new \TCPDF('P', 'mm', 'A4', true, 'ISO-8859-1');
-            $tcPdf->setPrintHeader(false);
-            $tcPdf->setPrintFooter(false);
-            $tcPdf->AddPage();
-
-            $output = (new TcPdfOutput($qrBill, 'en', $tcPdf));
-            $output
-                ->setPrintable($variation['printable'])
-                ->setQrCodeImageFormat($variation['format'])
-                ->getPaymentPart();
-
-            if ($this->regenerateReferenceFiles) {
-                $tcPdf->Output($file, 'F');
-            }
-
-            $contents = $this->getActualPdfContents($tcPdf->Output($file, 'S'));
-
-            $this->assertNotNull($contents);
-            $this->assertSame($this->getActualPdfContents(file_get_contents($file)), $contents);
-        }
-    }
-
-    private function getActualPdfContents(string $fileContents): ?string
-    {
-        // Extract actual pdf content and ignore all meta data which may differ in different versions of TcPdf
-        $pattern = '/stream(.*?)endstream/s';
-        preg_match($pattern, $fileContents, $matches);
-
-        if (isset($matches[1])) {
-            return $matches[1];
-        }
-
-        return null;
-    }
-}

+ 0 - 48
htdocs/includes/sprain/swiss-qr-bill/tests/PaymentPart/TranslationTest.php

@@ -1,48 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\PaymentPart;
-
-use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts;
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\PaymentPart\Translation\Translation;
-
-final class TranslationTest extends TestCase
-{
-    use ArraySubsetAsserts;
-
-    /**
-     * @dataProvider allTranslationsProvider
-     */
-    public function testAllByLanguage(string $locale, array $subset): void
-    {
-        $this->assertArraySubset($subset, Translation::getAllByLanguage($locale));
-    }
-
-    public function allTranslationsProvider(): array
-    {
-        return [
-            ['de', ['paymentPart' => 'Zahlteil']],
-            ['fr', ['paymentPart' => 'Section paiement']],
-            ['it', ['paymentPart' => 'Sezione pagamento']],
-            ['en', ['paymentPart' => 'Payment part']]
-        ];
-    }
-
-    /**
-     * @dataProvider singleTranslationProvider
-     */
-    public function testGet(string $locale, string $key, string $translation)
-    {
-        $this->assertSame($translation, Translation::get($key, $locale));
-    }
-
-    public function singleTranslationProvider(): array
-    {
-        return [
-            ['de', 'paymentPart', 'Zahlteil'],
-            ['fr', 'paymentPart', 'Section paiement'],
-            ['it', 'paymentPart', 'Sezione pagamento'],
-            ['en', 'paymentPart', 'Payment part']
-        ];
-    }
-}

+ 0 - 247
htdocs/includes/sprain/swiss-qr-bill/tests/QrBillTest.php

@@ -1,247 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\DataGroup\Element\AlternativeScheme;
-use Sprain\SwissQrBill\Exception\InvalidQrBillDataException;
-use Sprain\SwissQrBill\QrBill;
-use Zxing\QrReader;
-
-final class QrBillTest extends TestCase
-{
-    use TestQrBillCreatorTrait;
-
-    /**
-     * @dataProvider validQrBillsProvider
-     */
-    public function testValidQrBills(string $name, QrBill $qrBill)
-    {
-        $file = __DIR__ . '/TestData/QrCodes/' . $name . '.png';
-        $textFile = __DIR__ . '/TestData/QrCodes/' . $name . '.txt';
-
-        if ($this->regenerateReferenceFiles) {
-            $qrBill->getQrCode()->writeFile($file);
-            file_put_contents($textFile, $qrBill->getQrCode()->getText());
-        }
-
-        $this->assertEquals(
-            file_get_contents($textFile),
-            $qrBill->getQrCode()->getText()
-        );
-    }
-
-    public function testAlternativeSchemesCanBeSetAtOnce()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'creditor',
-            'paymentAmountInformation',
-            'paymentReferenceQr',
-        ]);
-
-        $qrBill->setAlternativeSchemes([
-            AlternativeScheme::create('foo'),
-            AlternativeScheme::create('foo')
-        ]);
-
-        $this->assertSame(
-            (new QrReader(__DIR__ . '/TestData/QrCodes/qr-alternative-schemes.png'))->text(),
-            $qrBill->getQrCode()->getText()
-        );
-    }
-
-    public function testHeaderMustBeValid()
-    {
-        $qrBill = $this->createQrBill([
-            'invalidHeader',
-            'creditorInformationQrIban',
-            'creditor',
-            'paymentAmountInformation',
-            'paymentReferenceQr'
-        ]);
-
-        $this->assertFalse($qrBill->isValid());
-    }
-
-    public function testHeaderIsCreatedInStaticConstructor()
-    {
-        $qrBill = QrBill::create();
-
-        $this->creditorInformationQrIban($qrBill);
-        $this->creditor($qrBill);
-        $this->paymentAmountInformation($qrBill);
-        $this->paymentReferenceQr($qrBill);
-
-        $this->assertTrue($qrBill->isValid());
-    }
-
-    public function testCreditorInformationIsRequired()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditor',
-            'paymentAmountInformation',
-            'paymentReferenceQr'
-        ]);
-
-        $this->assertSame(1, $qrBill->getViolations()->count());
-    }
-
-    public function testCreditorInformationMustBeValid()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'invalidCreditorInformation',
-            'creditor',
-            'paymentAmountInformation',
-            'paymentReferenceQr'
-        ]);
-
-        $this->assertFalse($qrBill->isValid());
-    }
-
-    public function testCreditorIsRequired()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'paymentAmountInformation',
-            'paymentReferenceQr'
-        ]);
-
-        $this->assertSame(1, $qrBill->getViolations()->count());
-    }
-
-    public function testCreditorMustBeValid()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'invalidCreditor',
-            'paymentAmountInformation',
-            'paymentReferenceQr'
-        ]);
-
-        $this->assertFalse($qrBill->isValid());
-    }
-
-    public function testPaymentAmountInformationIsRequired()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'creditor',
-            'paymentReferenceQr'
-        ]);
-
-        $this->assertSame(1, $qrBill->getViolations()->count());
-    }
-
-    public function testPaymentAmountInformationMustBeValid()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'creditor',
-            'invalidPaymentAmountInformation',
-            'paymentReferenceQr'
-        ]);
-
-        $this->assertFalse($qrBill->isValid());
-    }
-
-    public function testPaymentReferenceIsRequired()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'creditor',
-            'paymentAmountInformation',
-        ]);
-
-        $this->assertSame(1, $qrBill->getViolations()->count());
-    }
-
-    public function testPaymentReferenceMustBeValid()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'creditor',
-            'paymentAmountInformation',
-            'invalidPaymentReference'
-        ]);
-
-        $this->assertFalse($qrBill->isValid());
-    }
-
-    public function testNonMatchingAccountAndReference()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationIban',
-            'creditor',
-            'paymentAmountInformation',
-            'paymentReferenceQr'
-        ]);
-
-        $this->assertFalse($qrBill->isValid());
-    }
-
-    public function testOptionalUltimateDebtorMustBeValid()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'creditor',
-            'paymentAmountInformation',
-            'paymentReferenceQr',
-            'invalidUltimateDebtor'
-        ]);
-
-        $this->assertFalse($qrBill->isValid());
-    }
-
-    public function testAlternativeSchemesMustBeValid()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'creditor',
-            'paymentAmountInformation',
-            'paymentReferenceQr',
-        ]);
-
-        $qrBill->addAlternativeScheme(AlternativeScheme::create('foo'));
-        $qrBill->addAlternativeScheme(AlternativeScheme::create(''));
-
-        $this->assertFalse($qrBill->isValid());
-    }
-
-    public function testMaximumTwoAlternativeSchemesAreAllowed()
-    {
-        $qrBill = $this->createQrBill([
-            'header',
-            'creditorInformationQrIban',
-            'creditor',
-            'paymentAmountInformation',
-            'paymentReferenceQr'
-        ]);
-
-        $qrBill->addAlternativeScheme(AlternativeScheme::create('foo'));
-        $qrBill->addAlternativeScheme(AlternativeScheme::create('foo'));
-        $qrBill->addAlternativeScheme(AlternativeScheme::create('foo'));
-
-        $this->assertFalse($qrBill->isValid());
-    }
-
-    public function testCatchInvalidData()
-    {
-        $this->expectException(InvalidQrBillDataException::class);
-
-        $qrBill = QrBill::create();
-        $qrBill->getQrCode();
-    }
-}

文件差异内容过多而无法显示
+ 0 - 76
htdocs/includes/sprain/swiss-qr-bill/tests/QrCode/QrCodeTest.php


+ 0 - 134
htdocs/includes/sprain/swiss-qr-bill/tests/Reference/QrPaymentReferenceGeneratorTest.php

@@ -1,134 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\Reference;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\Reference\QrPaymentReferenceGenerator;
-use Sprain\SwissQrBill\Validator\Exception\InvalidQrPaymentReferenceException;
-use Symfony\Component\Validator\Validation;
-use Symfony\Component\Validator\Validator\ValidatorInterface;
-
-final class QrPaymentReferenceGeneratorTest extends TestCase
-{
-    /** @var  ValidatorInterface */
-    private $validator;
-
-    public function setUp(): void
-    {
-        $this->validator = Validation::createValidatorBuilder()
-            ->addMethodMapping('loadValidatorMetadata')
-            ->getValidator();
-    }
-
-    /**
-     * @dataProvider qrPaymentReferenceProvider
-     */
-    public function testMakesResultsViaConstructor(?string $customerIdentification, string $referenceNumber, string $expectedResult): void
-    {
-        $qrReference = new QrPaymentReferenceGenerator(
-            $customerIdentification,
-            $referenceNumber
-        );
-
-        $this->assertSame($expectedResult, $qrReference->doGenerate());
-    }
-
-    /**
-     * @dataProvider qrPaymentReferenceProvider
-     */
-    public function testMakesResultsViaFacade(?string $customerIdentification, string $referenceNumber, string $expectedResult): void
-    {
-        $qrReference = QrPaymentReferenceGenerator::generate(
-            $customerIdentification,
-            $referenceNumber
-        );
-
-        $this->assertSame($expectedResult, $qrReference);
-    }
-
-    public function qrPaymentReferenceProvider(): array
-    {
-        return [
-            // Realistic real-life examples
-            ['310014', '18310019779911119', '310014000183100197799111196'], // https://www.tkb.ch/download/online/BESR-Handbuch.pdf
-            ['040329', '340 ', '040329000000000000000003406'], // https://www.lukb.ch/documents/10620/13334/LUKB-BESR-Handbuch.pdf
-            ['247656', '3073000002311006 ', '247656000030730000023110061'], // https://hilfe.flexbuero.ch/article/1181/
-            ['123456', '11223344', '123456000000000000112233440'],
-            ['1234567890', '11223344', '123456789000000000112233444'],
-            ['1234', '11223344', '123400000000000000112233449'],
-            ['000000', '11223344', '000000000000000000112233442'],
-            ['', '11223344', '000000000000000000112233442'],
-            [null, '11223344', '000000000000000000112233442'],
-
-            // Correct handling of whitespace
-            [' 310 014 ', ' 1831001 9779911119 ', '310014000183100197799111196'],
-        ];
-    }
-
-    /**
-     * @dataProvider invalidQrPaymentReferenceProvider
-     */
-    public function testInvalidQrPaymentReference(?string $customerIdentification, string $referenceNumber): void
-    {
-        $this->expectException(InvalidQrPaymentReferenceException::class);
-
-        QrPaymentReferenceGenerator::generate(
-            $customerIdentification,
-            $referenceNumber
-        );
-    }
-
-    public function invalidQrPaymentReferenceProvider(): array
-    {
-        return [
-            ['1234', '12345678901234567890123'], // too long in total
-            ['123456', '123456789012345678901'], // too long in total
-            ['12345678901', '1234567890123456'], // too long in total
-            [null, '123456789012345678901234567'], // too long in total
-        ];
-    }
-
-    /**
-     * @dataProvider invalidCustomerIdentificationNumberProvider
-     */
-    public function testInvalidCustomerIdentificationNumber(string $value): void
-    {
-        $this->expectException(InvalidQrPaymentReferenceException::class);
-
-        QrPaymentReferenceGenerator::generate(
-            $value,
-            '18310019779911119'
-        );
-    }
-
-    public function invalidCustomerIdentificationNumberProvider(): array
-    {
-        return [
-            ['123456789012'], // too long
-            ['12345A'],  // non-digits
-            ['1234.5'],  // non-digits
-        ];
-    }
-
-    /**
-     * @dataProvider invalidReferenceNumberProvider
-     */
-    public function testInvalidReferenceNumber(string $value): void
-    {
-        $this->expectException(InvalidQrPaymentReferenceException::class);
-        
-        QrPaymentReferenceGenerator::generate(
-            '123456',
-            $value
-        );
-    }
-
-    public function invalidReferenceNumberProvider(): array
-    {
-        return [
-            ['1234567890123456789A'],  // non-digits
-            ['123456789012345678.0'],  // non-digits
-            ['']
-        ];
-    }
-}

+ 0 - 69
htdocs/includes/sprain/swiss-qr-bill/tests/Reference/RfCreditorReferenceGeneratorTest.php

@@ -1,69 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\Reference;
-
-use Sprain\SwissQrBill\Reference\RfCreditorReferenceGenerator;
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\String\StringModifier;
-
-final class RfCreditorReferenceGeneratorTest extends TestCase
-{
-    /**
-     * @dataProvider rfCreditorReferenceProvider
-     */
-    public function testMakesResultsViaConstructor(string $input): void
-    {
-        $generator = new RfCreditorReferenceGenerator($input);
-
-        $output = $generator->doGenerate();
-
-        $this->assertStringContainsStringIgnoringCase(
-            StringModifier::stripWhitespace($input),
-            StringModifier::stripWhitespace($output)
-        );
-    }
-
-    /**
-     * @dataProvider rfCreditorReferenceProvider
-     */
-    public function testMakesResultsViaFacade(string $input): void
-    {
-        $output = RfCreditorReferenceGenerator::generate($input);
-
-        $this->assertStringContainsStringIgnoringCase(
-            StringModifier::stripWhitespace($input),
-            StringModifier::stripWhitespace($output)
-        );
-    }
-
-    public function rfCreditorReferenceProvider(): array
-    {
-        return [
-            ['1'],
-            ['a'],
-            ['B'],
-            ['aBcD eFgH iJkL mNoP qR12 3'],
-        ];
-    }
-
-    /**
-     * @dataProvider invalidReferenceProvider
-     */
-    public function testInvalidReference(string $input): void
-    {
-        $generator = new RfCreditorReferenceGenerator($input);
-
-        $this->assertGreaterThan(0, $generator->getViolations()->count());
-    }
-
-    public function invalidReferenceProvider(): array
-    {
-        return [
-            ['aBcD eFgH iJkL mNoP qR12 34'], // to long
-            [''], // to short
-            ['123ä'], // invalid letter
-            ['123.'], // invalid symbol
-        ];
-    }
-
-}

+ 0 - 74
htdocs/includes/sprain/swiss-qr-bill/tests/String/StringModifierTest.php

@@ -1,74 +0,0 @@
-<?php declare(strict_types=1);
-
-namespace Sprain\Tests\SwissQrBill\String;
-
-use PHPUnit\Framework\TestCase;
-use Sprain\SwissQrBill\String\StringModifier;
-
-final class StringModifierTest extends TestCase
-{
-    /**
-     * @dataProvider lineBreaksAndTabsProvider
-     */
-    public function testRemoveLineBreaksAndTabs(?string $string, string $expectedResult): void
-    {
-        $this->assertSame(
-            $expectedResult,
-            StringModifier::replaceLineBreaksAndTabsWithSpaces($string)
-        );
-    }
-
-    public function lineBreaksAndTabsProvider(): array
-    {
-        return [
-            [null, ''],
-            ["foo\nbar\rbaz\r\n", "foo bar baz  "],
-            ["\n\nfoo\nbar\tbaz\n\n", "  foo bar baz  "],
-            ["\n\nfoo\n\nbar\t\nbaz\n\n", "  foo  bar  baz  "],
-        ];
-    }
-
-    /**
-     * @dataProvider multipleSpacesProvider
-     */
-    public function testReplaceMultipleSpacesWithOne(?string $string, string $expectedResult): void
-    {
-        $this->assertSame(
-            $expectedResult,
-            StringModifier::replaceMultipleSpacesWithOne($string)
-        );
-    }
-
-    public function multipleSpacesProvider(): array
-    {
-        return [
-            [null, ''],
-            [" foo bar baz ", " foo bar baz "],
-            ["  foo  bar  baz  ", " foo bar baz "],
-            ["foo  bar  baz", "foo bar baz"],
-        ];
-    }
-
-    /**
-     * @dataProvider stripWhitespaceProvider
-     */
-    public function testStripWhitespace(?string $string, string $expectedResult): void
-    {
-        $this->assertSame(
-            $expectedResult,
-            StringModifier::stripWhitespace($string)
-        );
-    }
-
-    public function stripWhitespaceProvider(): array
-    {
-        return [
-            [null, ''],
-            ['1 ', '1'],
-            [' 2', '2'],
-            [' foo ', 'foo'],
-            ['   foo   ', 'foo'],
-            ['   foo   bar   ', 'foobar'],
-        ];
-    }
-}

二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-additional-information.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-additional-information.print.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-alternative-schemes.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-alternative-schemes.print.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-full-set.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-full-set.print.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-international-ultimate-debtor.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-international-ultimate-debtor.print.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-minimal-setup.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-minimal-setup.print.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-with-mediumlong-creditor-and-unknown-debtor.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-with-mediumlong-creditor-and-unknown-debtor.print.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-without-amount-and-long-addresses.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-without-amount-and-long-addresses.print.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-without-amount-but-debtor.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-without-amount-but-debtor.print.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-without-amount.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-without-amount.print.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-zero-amount.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-information-zero-amount.print.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-reference-non.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-reference-non.print.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-reference-scor.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-payment-reference-scor.print.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-ultimate-debtor.pdf


二进制
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/FpdfOutput/qr-ultimate-debtor.print.pdf


文件差异内容过多而无法显示
+ 0 - 205
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-additional-information.svg.html


文件差异内容过多而无法显示
+ 0 - 215
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-additional-information.svg.print.html


文件差异内容过多而无法显示
+ 0 - 205
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-alternative-schemes.svg.html


文件差异内容过多而无法显示
+ 0 - 215
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-alternative-schemes.svg.print.html


文件差异内容过多而无法显示
+ 0 - 207
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-full-set.svg.html


文件差异内容过多而无法显示
+ 0 - 217
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-full-set.svg.print.html


文件差异内容过多而无法显示
+ 0 - 207
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-international-ultimate-debtor.svg.html


文件差异内容过多而无法显示
+ 0 - 217
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-international-ultimate-debtor.svg.print.html


文件差异内容过多而无法显示
+ 0 - 205
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-minimal-setup.svg.html


文件差异内容过多而无法显示
+ 0 - 215
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-minimal-setup.svg.print.html


文件差异内容过多而无法显示
+ 0 - 204
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-payment-information-with-mediumlong-creditor-and-unknown-debtor.svg.html


文件差异内容过多而无法显示
+ 0 - 214
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-payment-information-with-mediumlong-creditor-and-unknown-debtor.svg.print.html


文件差异内容过多而无法显示
+ 0 - 203
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-payment-information-without-amount-and-long-addresses.svg.html


文件差异内容过多而无法显示
+ 0 - 213
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-payment-information-without-amount-and-long-addresses.svg.print.html


文件差异内容过多而无法显示
+ 0 - 207
htdocs/includes/sprain/swiss-qr-bill/tests/TestData/HtmlOutput/qr-payment-information-without-amount-but-debtor.svg.html


部分文件因为文件数量过多而无法显示