This commit is contained in:
@@ -53,6 +53,14 @@ final class WarmwasserReglerTest extends TestCase
|
||||
self::assertEqualsWithDelta(20.4, WarmwasserRegler::pt1(20.0, 30.0, 5, 120), 0.001);
|
||||
}
|
||||
|
||||
public function testLastwechselRestzeitWirdInSekundenBerechnet(): void
|
||||
{
|
||||
self::assertSame(0, WarmwasserRegler::restzeitBisLastwechsel(0, 100, 5));
|
||||
self::assertSame(5, WarmwasserRegler::restzeitBisLastwechsel(100, 100, 5));
|
||||
self::assertSame(2, WarmwasserRegler::restzeitBisLastwechsel(100, 103, 5));
|
||||
self::assertSame(0, WarmwasserRegler::restzeitBisLastwechsel(100, 105, 5));
|
||||
}
|
||||
|
||||
public function testEnergieWirdInKWhBerechnet(): void
|
||||
{
|
||||
self::assertEqualsWithDelta(3.0, WarmwasserRegler::energieKWh(3000.0, 3600), 0.000001);
|
||||
|
||||
@@ -29,14 +29,14 @@ final class WarmwassererwaermerModulstrukturTest extends TestCase
|
||||
self::assertMatchesRegularExpression('/^\{[0-9A-F-]{36}\}$/', $metadaten['id']);
|
||||
}
|
||||
|
||||
public function testAlle20PropertiesSindRegistriertUndImFormularDokumentiert(): void
|
||||
public function testAlle19PropertiesSindRegistriertUndImFormularDokumentiert(): void
|
||||
{
|
||||
$basis = (string) file_get_contents(__DIR__ . '/../libs/VerbraucherBasisTrait.php');
|
||||
$modul = (string) file_get_contents(self::MODULPFAD . 'module.php');
|
||||
preg_match_all('/RegisterProperty(?:Integer|Float|Boolean|String)\(\'([^\']+)\'/', $basis . $modul, $treffer);
|
||||
$properties = array_values(array_unique($treffer[1]));
|
||||
|
||||
self::assertCount(20, $properties);
|
||||
self::assertCount(19, $properties);
|
||||
|
||||
$formular = (string) file_get_contents(self::MODULPFAD . 'form.json');
|
||||
foreach ($properties as $property) {
|
||||
@@ -44,6 +44,18 @@ final class WarmwassererwaermerModulstrukturTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testRegelungIstEreignisbasiertUndSperrtLastwechselFuenfSekunden(): void
|
||||
{
|
||||
$inhalt = (string) file_get_contents(self::MODULPFAD . 'module.php');
|
||||
|
||||
self::assertStringContainsString("RegisterPropertyInteger('LastwechselSperrzeit', 5)", $inhalt);
|
||||
self::assertStringNotContainsString("RegisterPropertyInteger('Interval'", $inhalt);
|
||||
self::assertStringNotContainsString("RegisterPropertyInteger('IdleCounterMax'", $inhalt);
|
||||
self::assertStringNotContainsString("ReadPropertyInteger('Interval')", $inhalt);
|
||||
self::assertStringContainsString("'LastwechselFreigabe'", $inhalt);
|
||||
self::assertStringContainsString('LetzteTemperaturberechnung', $inhalt);
|
||||
}
|
||||
|
||||
public function testModulVerwendetAusschliesslichDenVertrag30(): void
|
||||
{
|
||||
$inhalt = (string) file_get_contents(self::MODULPFAD . 'module.php');
|
||||
|
||||
Reference in New Issue
Block a user