feat: 前台 .shtml 后缀 canonical + strict_types 全量启用 + 对外 API(Sanctum+Scramble 文档)+ pm2 ecosystem + GitHub Actions CI + 插件/主题/架构/API 文档 + REDIS_PREFIX 说明
This commit is contained in:
@@ -41,25 +41,43 @@ class LegacyRoutesTest extends TestCase
|
||||
|
||||
public function test_rewrite_style_urls_redirect(): void
|
||||
{
|
||||
$this->get('/show-12.html')->assertRedirect('/posts/legacy-post');
|
||||
$this->get('/show-12-1.html')->assertRedirect('/posts/legacy-post');
|
||||
$this->get('/show-12.html')->assertRedirect('/posts/legacy-post.shtml');
|
||||
$this->get('/show-12-1.html')->assertRedirect('/posts/legacy-post.shtml');
|
||||
$this->get('/category-1.html')->assertRedirect();
|
||||
$this->get('/archives-'.now()->format('Ymd').'.html')->assertRedirect();
|
||||
$this->get('/tagslist.html')->assertRedirect('/tags');
|
||||
$this->get('/links.shtml')->assertRedirect('/links');
|
||||
$this->get('/login.shtml')->assertRedirect('/login');
|
||||
$this->get('/reg.shtml')->assertRedirect('/register');
|
||||
$this->get('/tagslist.html')->assertRedirect('/tags.shtml');
|
||||
$this->get('/reg.shtml')->assertRedirect('/register.shtml');
|
||||
}
|
||||
|
||||
public function test_shtml_canonical_pages_render(): void
|
||||
{
|
||||
$this->get('/links.shtml')->assertOk();
|
||||
$this->get('/login.shtml')->assertOk();
|
||||
$this->get('/comments.shtml')->assertOk();
|
||||
$this->get('/search.shtml')->assertOk();
|
||||
$this->get('/tags.shtml')->assertOk();
|
||||
$this->get('/archives.shtml')->assertOk();
|
||||
$this->get('/posts/legacy-post.shtml')->assertOk();
|
||||
}
|
||||
|
||||
public function test_no_suffix_urls_redirect_to_shtml(): void
|
||||
{
|
||||
$this->get('/links')->assertRedirect('/links.shtml');
|
||||
$this->get('/login')->assertRedirect('/login.shtml');
|
||||
$this->get('/comments')->assertRedirect('/comments.shtml');
|
||||
$this->get('/archives')->assertRedirect('/archives.shtml');
|
||||
$this->get('/posts/legacy-post')->assertRedirect('/posts/legacy-post.shtml');
|
||||
}
|
||||
|
||||
public function test_query_style_urls_redirect(): void
|
||||
{
|
||||
$this->get('/?action=show&id=12')->assertRedirect('/posts/legacy-post');
|
||||
$this->get('/?action=show&id=12')->assertRedirect('/posts/legacy-post.shtml');
|
||||
$this->get('/?action=category&cid=1')->assertRedirect();
|
||||
$this->get('/?action=index&setdate='.now()->format('Ym'))->assertRedirect();
|
||||
$this->get('/?action=search&keyword=laravel')->assertRedirect('/search?q=laravel');
|
||||
$this->get('/?action=links')->assertRedirect('/links');
|
||||
$this->get('/?action=archives')->assertRedirect('/archives');
|
||||
$this->get('/?action=comments')->assertRedirect('/comments');
|
||||
$this->get('/?action=search&keyword=laravel')->assertRedirect('/search.shtml?q=laravel');
|
||||
$this->get('/?action=links')->assertRedirect('/links.shtml');
|
||||
$this->get('/?action=archives')->assertRedirect('/archives.shtml');
|
||||
$this->get('/?action=comments')->assertRedirect('/comments.shtml');
|
||||
}
|
||||
|
||||
public function test_trackback_endpoints_are_gone(): void
|
||||
@@ -86,6 +104,6 @@ class LegacyRoutesTest extends TestCase
|
||||
$tag = Tag::create(['name' => 'laravel-tag', 'type' => 'post']);
|
||||
Setting::set('legacy_tags', [1 => $tag->id]);
|
||||
|
||||
$this->get('/?action=tags&id=1')->assertRedirect('/tags/laravel-tag');
|
||||
$this->get('/?action=tags&id=1')->assertRedirect('/tags/laravel-tag.shtml');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user