Portiere PHP-Cronjobs auf Spring-Tasks und ergänze Legacy-Tests
Migriert die weiterhin benötigten Zeitaufgaben einschließlich SOAP-Importen, Betriebsstatus und Wiederanlaufkontrolle. Aktiviert 115 native Spring-Tasks im Docker-Image ohne Cron-Daemon oder PHP und dokumentiert die entfallenen HHA-Aufrufe. Ergänzt PHP-/UI-Testwerkzeuge und aktualisiert den Projektstand auf Version 0.2.0.
This commit is contained in:
1 parent
781a2b82dc
commit
9de2358480
57 files changed
+3251
-7
No files matched your search
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
|
||||
final class FormattingTest extends LegacyTestCase
|
||||
{
|
||||
#[DataProvider('formats')]
|
||||
public function testLegacyOutput(string $value, string $type, string $format, string $decimals, string $expected): void
|
||||
{
|
||||
self::assertSame($expected, formatOutput($value, $type, $format, $decimals));
|
||||
}
|
||||
|
||||
public static function formats(): array
|
||||
{
|
||||
return [
|
||||
'empty cell' => ['', 'varchar', '1', '', ' '],
|
||||
'trim text' => [' Test ', 'text', '1', '', 'Test'],
|
||||
'zero number' => ['0', 'number', '1', '2', '0,00'],
|
||||
'positive half cent' => ['1234.565', 'number', '1', '2', '1.234,57'],
|
||||
'negative half cent' => ['-1234.565', 'number', '1', '2', '-1.234,57'],
|
||||
'integer rounding' => ['1234.5', 'number', '1', '0', '1.235'],
|
||||
'numeric string unformatted' => ['001.20', 'number', '1', '', '001.20'],
|
||||
'non-numeric preserved' => ['12,30', 'number', '1', '2', '12,30'],
|
||||
'invalid number preserved' => ['bad <value>', 'number', '1', '2', 'bad <value>'],
|
||||
'rounded float' => ['1234.565', 'float_rounded_2', '1', '', '1.234,57'],
|
||||
'comma decimal normalized' => ['12,3', 'float', '1', '', '12.30'],
|
||||
'float with comma' => ['12.345', 'float', '2', '', '12,35'],
|
||||
'float as cents' => ['12.3', 'float', '3', '', '1230'],
|
||||
'boolean false' => ['0', 'bool', '1', '', ' '],
|
||||
'boolean true' => ['1', 'bool', '1', '', '<img src="../images/circle.png" height="8" width="8">'],
|
||||
'datetime time' => ['2026-10-26 14:35:59', 'datetime', '2', '', '14.35.59'],
|
||||
'datetime full' => ['2026-10-26 14:35:59', 'datetime', '3', '', '26.10.26 : 14.35.59'],
|
||||
'date four digit year' => ['2026-10-26 14:35:59', 'datetime', '4', '', '26.10.2026'],
|
||||
'date two digit year' => ['2026-10-26 14:35:59', 'datetime', '5', '', '26.10.26'],
|
||||
'sortable date' => ['2026-10-26 14:35:59', 'datetime', '8', '', '2026.10.26'],
|
||||
'compact date' => ['2026-10-26 14:35:59', 'datetime', '9', '', '20261026'],
|
||||
'hours minutes' => ['2026-10-26 14:35:59', 'datetime', '10', '', '14:35'],
|
||||
'month year' => ['2026-10-26 14:35:59', 'datetime', '11', '', '10/26'],
|
||||
'compact timestamp' => ['2026-10-26 14:35:59', 'datetime', '12', '', '20261026143559'],
|
||||
'full year time display' => ['2026-10-26 14:35:59', 'datetime', '14', '', '14:35 (26.10.2026)'],
|
||||
'classic timestamp' => ['20261026143559', 'timestamp_classic', '1', '', '26.10.26 : 14.35.59'],
|
||||
];
|
||||
}
|
||||
|
||||
public function testGlobalTimestampWrapperParameter(): void
|
||||
{
|
||||
FixtureState::$parameters[0]['DB_FIELDTYPE_WRAPPER_1'] = '1';
|
||||
self::assertSame('26.10.26 : 14.35.59', formatOutput('2026-10-26 14:35:59', 'timestamp'));
|
||||
}
|
||||
|
||||
public function testHeadquartersParameterOverridesGlobalTimestampWrapper(): void
|
||||
{
|
||||
FixtureState::$parameters[0]['DB_FIELDTYPE_WRAPPER_1'] = '1';
|
||||
FixtureState::$parameters[7]['DB_FIELDTYPE_WRAPPER_1'] = '0';
|
||||
self::assertSame('26.10.26 : 14.35.59', formatOutput('20261026143559', 'timestamp'));
|
||||
}
|
||||
|
||||
#[DataProvider('phoneNumbers')]
|
||||
public function testPhoneNormalization(string $input, array $parameters, string $expected): void
|
||||
{
|
||||
FixtureState::$parameters = $parameters;
|
||||
self::assertSame($expected, eregPhoneNo($input));
|
||||
}
|
||||
|
||||
public static function phoneNumbers(): array
|
||||
{
|
||||
return ['local' => ['0171 123-456', [], '171123456'],
|
||||
'international plus' => ['+49 171 123456', [], '171123456'],
|
||||
'international zeros' => ['0049 171 123456', [], '171123456'],
|
||||
'foreign prefix kept' => ['0044 20 123456', [], '4420123456'],
|
||||
'empty' => ['', [], ''],
|
||||
'headquarters prefix' => ['+43 664 123456', [7 => ['COUNTRY_FON_PREFIX' => '43']], '664123456'],
|
||||
'global prefix' => ['+43 664 123456', [0 => ['COUNTRY_FON_PREFIX' => '43']], '664123456'],
|
||||
'headquarters overrides global' => ['+43 664 123456', [0 => ['COUNTRY_FON_PREFIX' => '49'], 7 => ['COUNTRY_FON_PREFIX' => '43']], '664123456']];
|
||||
}
|
||||
|
||||
#[DataProvider('lists')]
|
||||
public function testRemoveExactListItem(string $list, string $item, string $delimiter, string $expected): void
|
||||
{
|
||||
self::assertSame($expected, removeItemStringList($list, $item, $delimiter));
|
||||
}
|
||||
|
||||
public static function lists(): array
|
||||
{
|
||||
return [['123|23|234', '23', '|', '123|234'], ['23|123', '23', '|', '123'],
|
||||
['123|23', '23', '|', '123'], ['23', '23', '|', ''],
|
||||
['123|234', '23', '|', '123|234'], ['', '23', '|', ''],
|
||||
['a,b,c', 'b', ',', 'a,c'], ['23|23|123', '23', '|', '23|123']];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user