favicon(); $from = __DIR__ . '/../stubs/logo.png'; artisan(GenerateFaviconsCommand::class, [ 'from' => $from, ])->assertSuccessful(); assertFileExists(public_path('favicon.ico')); assertFileExists(public_path('favicon.png')); }); test('it should fail because the from path is incorrect', function () { seo()->favicon(); artisan(GenerateFaviconsCommand::class, [ 'from' => 'i/dont/exist.png', ])->assertFailed(); assertFileDoesNotExist(public_path('favicon.ico')); assertFileDoesNotExist(public_path('favicon.png')); }); test('it should have custom value with non-empty string', function () { seo()->favicon('foo'); expect(seo('favicon'))->toBe('foo'); expect(meta())->toContain(''); }); test('it should not have custom value with empty string or false', function () { seo()->favicon(''); expect(seo('favicon'))->toBe(null); expect(meta())->not()->toContain('link rel="icon"'); expect(seo('favicon'))->toBe(null); expect(meta())->not()->toContain('link rel="icon"'); }); test('it should have default favicon setup', function () { seo()->favicon(); expect(seo('favicon'))->toBe(null); expect(meta())->toContain(''); expect(meta())->toContain(''); });