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,44 @@
|
||||
<?php
|
||||
|
||||
final class LegacyFunctionsTest extends PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testOnlySelectedTopLevelFunctionIsExtracted(): void
|
||||
{
|
||||
$source = <<<'SOURCE'
|
||||
<?php
|
||||
file_put_contents('/never-execute', 'startup');
|
||||
// function wanted() { wrong }
|
||||
class Example { function wanted() { return 'method'; } }
|
||||
function unwanted() { return '}'; }
|
||||
function wanted($name) { /* } */ return "{$name}: }"; }
|
||||
SOURCE;
|
||||
$found = LegacyFunctions::extract($source, ['wanted']);
|
||||
self::assertSame(['wanted'], array_keys($found));
|
||||
self::assertSame('function wanted($name) { /* } */ return "{$name}: }"; }', $found['wanted']['code']);
|
||||
self::assertSame(6, $found['wanted']['line']);
|
||||
}
|
||||
|
||||
public function testMissingFunctionFailsClosed(): void
|
||||
{
|
||||
$this->expectException(RuntimeException::class);
|
||||
LegacyFunctions::extract('<?php function different() {}', ['wanted']);
|
||||
}
|
||||
|
||||
public function testNestedFunctionCannotBeMistakenForGlobalDeclaration(): void
|
||||
{
|
||||
$this->expectException(RuntimeException::class);
|
||||
LegacyFunctions::extract('<?php function outer() { function wanted() {} }', ['wanted']);
|
||||
}
|
||||
|
||||
public function testIncludesCannotLoadApplicationBootstrap(): void
|
||||
{
|
||||
$this->expectException(RuntimeException::class);
|
||||
LegacyFunctions::extract('<?php function wanted() { require "db.php"; }', ['wanted']);
|
||||
}
|
||||
|
||||
public function testDuplicateDefinitionsFailClosed(): void
|
||||
{
|
||||
$this->expectException(RuntimeException::class);
|
||||
LegacyFunctions::extract('<?php function wanted() {} function wanted() {}', ['wanted']);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user