assertSame('GB', $display->countryCode(['CountryIsoCode' => 'GBR'])); $this->assertSame('DE', $display->countryCode(['CountryIsoCode' => 'de'])); $this->assertSame('GB', $display->countryCode(['Country' => 'United Kingdom'])); $this->assertNull($display->countryCode(['CountryIsoCode' => 'ZZZZ'])); $this->assertNull($display->countryCode([])); } public function test_flag_renders_image_or_dash(): void { $display = new Display; $this->assertStringContainsString('flagcdn.com/w40/fr.png', (string) $display->flag(['CountryIsoCode' => 'FRA'])); $this->assertStringContainsString('—', (string) $display->flag([])); } public function test_date_times_are_readable_and_drop_midnight(): void { $display = new Display; $this->assertSame('Thu 8 Oct 2026', $display->dateTime('2026-10-08T00:00:00')); $this->assertSame('Thu 8 Oct 2026, 14:30', $display->dateTime('2026-10-08T14:30:00')); $this->assertSame('—', $display->dateTime(null)); $this->assertSame('not a date', $display->dateTime('not a date')); } }