Files
pterodactyl-panel/tests/Unit/DocumentationLinksTest.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

22 lines
784 B
PHP

<?php
declare(strict_types=1);
namespace Pterodactyl\Tests\Pest\Unit\DocumentationLinksTest;
use Illuminate\Support\Facades\File;
use Pterodactyl\Tests\TestCase;
use Symfony\Component\Finder\SplFileInfo;
uses(TestCase::class);
test('the panel never links to the 1.x documentation', function (): void {
$legacyLinks = collect([app_path(), resource_path('scripts'), resource_path('views'), resource_path('lang')])
->flatMap(fn (string $directory): array => File::allFiles($directory))
->filter(fn (SplFileInfo $file): bool => preg_match('#pterodactyl\.io/(panel|wings)/1\.0/#', $file->getContents()) === 1)
->map(fn (SplFileInfo $file): string => $file->getRelativePathname())
->values()
->all();
expect($legacyLinks)->toBe([]);
});