69 lines
2.5 KiB
PHP
69 lines
2.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Belevo\EnelixEMS\Tests;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class DokumentationsstrukturTest extends TestCase
|
|
{
|
|
/** @return list<array{string}> */
|
|
public function modulReadmes(): array
|
|
{
|
|
return [
|
|
['Batterie'],
|
|
['Pufferspeicher'],
|
|
['Waermepumpe'],
|
|
['Ladestation-Stand-Alone'],
|
|
['Ladestation-Gateway'],
|
|
['Easee-Gateway'],
|
|
];
|
|
}
|
|
|
|
/** @dataProvider modulReadmes */
|
|
public function testJederModulentwurfHatEinReadme(string $modul): void
|
|
{
|
|
$pfad = __DIR__ . '/../docs/module/' . $modul . '/README.md';
|
|
self::assertFileExists($pfad);
|
|
|
|
$inhalt = file_get_contents($pfad);
|
|
self::assertNotFalse($inhalt);
|
|
self::assertStringContainsString('Status: Diskussionsentwurf', $inhalt);
|
|
self::assertStringContainsString('Properties', $inhalt);
|
|
}
|
|
|
|
public function testSchnittstellenDokumentiertSind(): void
|
|
{
|
|
self::assertFileExists(__DIR__ . '/../docs/Schnittstelle.md');
|
|
self::assertFileExists(__DIR__ . '/../docs/Obere-Anschluesse.md');
|
|
self::assertFileExists(__DIR__ . '/../libs/VerbraucherBasisTrait.php');
|
|
}
|
|
|
|
public function testManagerDokumentiertDenImplementiertenStand(): void
|
|
{
|
|
$inhalt = file_get_contents(__DIR__ . '/../docs/module/Manager/README.md');
|
|
self::assertNotFalse($inhalt);
|
|
self::assertStringContainsString('Status: Implementiert', $inhalt);
|
|
self::assertStringContainsString('Verteilalgorithmus', $inhalt);
|
|
}
|
|
|
|
public function testVerbraucherEinStufigDokumentiertDenImplementiertenStand(): void
|
|
{
|
|
$inhalt = file_get_contents(__DIR__ . '/../docs/module/Verbraucher-1-Stufig/README.md');
|
|
self::assertNotFalse($inhalt);
|
|
self::assertStringContainsString('Status: implementiert', $inhalt);
|
|
self::assertStringContainsString('Umschaltabstand', $inhalt);
|
|
self::assertStringContainsString('Installation und Inbetriebnahme', $inhalt);
|
|
}
|
|
|
|
public function testWarmwassererwaermerDokumentiertDenImplementiertenStand(): void
|
|
{
|
|
$inhalt = file_get_contents(__DIR__ . '/../docs/module/Wassererwaermer/README.md');
|
|
self::assertNotFalse($inhalt);
|
|
self::assertStringContainsString('Status: implementiert', $inhalt);
|
|
self::assertStringContainsString('Properties', $inhalt);
|
|
self::assertStringContainsString('Managerkommunikation', $inhalt);
|
|
}
|
|
}
|