module('EaseeGateway'); $ladestation = $this->module('LadestationGateway'); self::assertContains( '{7AEF3DF7-DA5B-47C5-BCDC-0110D06DDC04}', $gateway['implemented'] ); self::assertContains( '{107D5CFA-8F3D-4E38-8643-90DDFE6A3B4D}', $gateway['childRequirements'] ); self::assertContains( '{7AEF3DF7-DA5B-47C5-BCDC-0110D06DDC04}', $ladestation['parentRequirements'] ); self::assertContains( '{107D5CFA-8F3D-4E38-8643-90DDFE6A3B4D}', $ladestation['implemented'] ); } public function testZugangsdatenLiegenNurImGateway(): void { $gatewayForm = (string) file_get_contents( __DIR__ . '/../EaseeGateway/form.json' ); $ladestationForm = (string) file_get_contents( __DIR__ . '/../LadestationGateway/form.json' ); self::assertStringContainsString('PasswordTextBox', $gatewayForm); self::assertStringNotContainsString('PasswordTextBox', $ladestationForm); self::assertStringNotContainsString('Username', $ladestationForm); } public function testLadestationVerwendetApiStatusUndGemeinsamenVertrag(): void { $modul = (string) file_get_contents( __DIR__ . '/../LadestationGateway/module.php' ); self::assertStringContainsString('implements VerbraucherSchnittstelle', $modul); self::assertStringContainsString('EaseeLadestatus::ausBeobachtungen', $modul); self::assertStringContainsString( "RegisterPropertyBoolean('Ladefreigabe', true)", $modul ); self::assertStringContainsString("'FahrzeugVerbunden'", $modul); self::assertStringContainsString("'Phasenzahl'", $modul); self::assertStringNotContainsString('7500', $modul); self::assertStringNotContainsString('Abfrageintervall', $modul); self::assertStringContainsString("'action' => 'StartCharging'", $modul); $gateway = (string) file_get_contents( __DIR__ . '/../EaseeGateway/module.php' ); self::assertStringContainsString('/commands/start_charging', $gateway); } /** @return array */ private function module(string $name): array { return json_decode( (string) file_get_contents(__DIR__ . '/../' . $name . '/module.json'), true, 512, JSON_THROW_ON_ERROR ); } }