feat(forecast): integrate full forecast charts and complete SDL visualization
Tests / test (push) Failing after 52s
Tests / test (push) Failing after 52s
This commit is contained in:
@@ -386,6 +386,68 @@ final class ManagerSDLTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testEnergyPieAttributionTracksSDLWithoutChangingCustomSettings(): void
|
||||
{
|
||||
$custom = [
|
||||
'ProduktionZaehlerID' => 801,
|
||||
'NetzbezugZaehlerID' => 802,
|
||||
'EinspeisungZaehlerID' => 803,
|
||||
'VerbrauchZaehlerID' => 804,
|
||||
'FarbeEigenverbrauch' => '#123456',
|
||||
'FarbeAutarkie' => '#ABCDEF',
|
||||
'Standardzeitraum' => 'month',
|
||||
'EnergieanteileBerechenbar' => true,
|
||||
];
|
||||
ManagerSDLRuntime::$properties[303] = $custom;
|
||||
$this->properties(['SDLAktiv' => true]);
|
||||
|
||||
$this->invoke('synchronisiereEnergyPieAnteile', [303]);
|
||||
self::assertSame(array_replace($custom, ['EnergieanteileBerechenbar' => false]),
|
||||
ManagerSDLRuntime::$properties[303]);
|
||||
$writes = ManagerSDLRuntime::$writes;
|
||||
$this->invoke('synchronisiereEnergyPieAnteile', [303]);
|
||||
self::assertSame($writes, ManagerSDLRuntime::$writes);
|
||||
|
||||
$this->properties(['SDLAktiv' => false]);
|
||||
$this->invoke('synchronisiereEnergyPieAnteile', [303]);
|
||||
self::assertSame($custom, ManagerSDLRuntime::$properties[303]);
|
||||
}
|
||||
|
||||
public function testOlderEnergyPieStaysVisibleWithoutSDLAndKeepsConfiguration(): void
|
||||
{
|
||||
$custom = ['ProduktionZaehlerID' => 801, 'FarbeEigenverbrauch' => '#123456'];
|
||||
ManagerSDLRuntime::$properties[303] = $custom;
|
||||
$this->properties(['SDLAktiv' => false]);
|
||||
|
||||
$this->invoke('synchronisiereEnergyPieAnteile', [303]);
|
||||
|
||||
self::assertSame($custom, ManagerSDLRuntime::$properties[303]);
|
||||
self::assertFalse(ManagerSDLRuntime::$hidden[303]);
|
||||
self::assertSame([], ManagerSDLRuntime::$logs);
|
||||
}
|
||||
|
||||
public function testOlderEnergyPieIsHiddenWithSDLAndRestoredAfterUtilsUpdate(): void
|
||||
{
|
||||
$custom = ['ProduktionZaehlerID' => 801, 'FarbeEigenverbrauch' => '#123456'];
|
||||
ManagerSDLRuntime::$properties[303] = $custom;
|
||||
$this->properties(['SDLAktiv' => true]);
|
||||
|
||||
$this->invoke('synchronisiereEnergyPieAnteile', [303]);
|
||||
|
||||
self::assertSame($custom, ManagerSDLRuntime::$properties[303]);
|
||||
self::assertTrue(ManagerSDLRuntime::$hidden[303]);
|
||||
self::assertCount(1, ManagerSDLRuntime::$logs);
|
||||
self::assertStringContainsString('Enelix Utils aktualisieren', ManagerSDLRuntime::$logs[0][1]);
|
||||
|
||||
ManagerSDLRuntime::$properties[303]['EnergieanteileBerechenbar'] = true;
|
||||
$this->invoke('synchronisiereEnergyPieAnteile', [303]);
|
||||
|
||||
self::assertFalse(ManagerSDLRuntime::$hidden[303]);
|
||||
self::assertSame(array_replace($custom, ['EnergieanteileBerechenbar' => false]),
|
||||
ManagerSDLRuntime::$properties[303]);
|
||||
self::assertCount(1, ManagerSDLRuntime::$logs);
|
||||
}
|
||||
|
||||
private function advanceCounters(): void
|
||||
{
|
||||
foreach ([201 => 102.0, 202 => 11.0, 203 => 5.2, 204 => 10.4, 205 => 8.1] as $id => $value) {
|
||||
|
||||
Reference in New Issue
Block a user