assertGreaterThan(1000, strlen($ico)); $this->assertSame("\x00\x00\x01\x00", substr($ico, 0, 4), 'favicon.ico ist keine ICO-Datei'); $svg = file_get_contents(public_path('favicon.svg')); $this->assertStringContainsString('assertStringContainsString('Lara & Felix', $svg); $png = file_get_contents(public_path('apple-touch-icon.png')); $this->assertSame("\x89PNG", substr($png, 0, 4)); } public function test_public_pages_link_the_icons(): void { $this->get('/')->assertOk() ->assertSee('href="'.asset('favicon.ico').'" sizes="any"', false) ->assertSee('href="'.asset('favicon.svg').'" type="image/svg+xml"', false) ->assertSee('rel="apple-touch-icon" href="'.asset('apple-touch-icon.png').'"', false); } public function test_the_sign_in_page_links_the_icons(): void { $this->get(route('login'))->assertOk() ->assertSee(asset('favicon.svg'), false); } public function test_the_member_area_links_the_icons(): void { $this->actingAs(User::factory()->create()) ->get(route('member.dashboard')) ->assertOk() ->assertSee(asset('favicon.svg'), false) ->assertSee(asset('apple-touch-icon.png'), false); } public function test_the_administration_login_uses_the_favicon(): void { $this->get('/verwaltung/login')->assertOk() ->assertSee('rel="icon" href="'.asset('favicon.svg').'"', false) ->assertSee('rel="apple-touch-icon"', false); } public function test_the_administration_icon_follows_the_opened_address_behind_a_proxy(): void { config(['app.url' => 'https://CHANGE-ME.example']); $this->withHeaders(['X-Forwarded-Host' => '', 'X-Forwarded-Port' => '', 'X-Forwarded-Proto' => '']) ->get('http://192.168.2.144:3011/verwaltung/login') ->assertOk() ->assertSee('href="http://192.168.2.144:3011/favicon.svg"', false) ->assertSee('href="http://192.168.2.144:3011/apple-touch-icon.png"', false) ->assertDontSee('CHANGE-ME.example'); } }