Nenne bei einem Netzwerkfehler der Shinkan-Anbindung die Ursache
Deploy Test / test (push) Successful in 3m17s
Deploy Test / deploy (push) Successful in 30s

Namensauflösung, abgelehnte Verbindung, Zeitüberschreitung und Zertifikat werden unterschieden. Genannt wird nur der
Servername, nie Pfad, Adresse oder Schlüssel.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-23 18:48:27 +01:00
1 parent e5b3eea7de
commit bb08b9b3fa
2 files changed
+55 -1

No files matched your search

+26
View File
@@ -18,6 +18,7 @@
use App\Models\User;
use Filament\Facades\Filament;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Http\Client\Factory;
use Illuminate\Support\Facades\Http;
use Livewire\Livewire;
@@ -465,6 +466,31 @@ public function test_the_address_may_name_the_installation_or_its_api_path_witho
}
}
public function test_a_network_failure_names_the_cause_and_the_host_but_no_address_path_or_key(): void
{
config(['services.shinkan.url' => 'https://dev.shinkan.jinkendo.de']);
$cases = [
'cURL error 6: Could not resolve host: dev.shinkan.jinkendo.de (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://dev.shinkan.jinkendo.de/api/distribution/v1/catalog' => 'Namensauflösung',
'cURL error 7: Failed to connect to dev.shinkan.jinkendo.de port 443' => 'Firewall',
'cURL error 28: Connection timed out after 20001 milliseconds' => 'Zeit überschritten',
'cURL error 60: SSL certificate problem' => 'Zertifikat',
'irgendetwas anderes' => 'Netzwerkfehler.',
];
foreach ($cases as $message => $expected) {
$this->freshHttp();
Http::fake(fn () => throw new ConnectionException($message));
$result = app(ShinkanImport::class)->check();
$this->assertFalse($result['ok']);
$this->assertStringContainsString('dev.shinkan.jinkendo.de', $result['message']);
$this->assertStringContainsString($expected, $result['message']);
$this->assertStringNotContainsString('/api/', $result['message']);
$this->assertStringNotContainsString('geheim-fuer-den-test', $result['message']);
}
}
public function test_the_exercise_list_leads_to_the_takeover_page(): void
{
Livewire::actingAs($this->staff('redakteur'), 'staff')