Expand blog to 36 mirrored posts with deepened sections and page-turn links
Deploy Backend / deploy (push) Successful in 2m35s

- Six new topic pairs (EN+FA): TypeScript advanced patterns, SQL indexes,
  Git branching/reviews, TDD, clean architecture in Laravel, browser page load
- Every existing post gains Key takeaways + FAQ sections in both languages
- New engineering-practices category pair and database/git/testing tag pairs
- Single-post API now returns same-language previous_post/next_post links
This commit is contained in:
Parsa Aghayi committed 2026-10-02 09:34:53 -04:00
1 parent d659c5d325
commit fbacb0c9a1
4 files changed
+1377 -9

No files matched your search

@@ -25,9 +25,9 @@ class RealBlogContentSeederTest extends TestCase
$this->seed(RealBlogContentSeeder::class);
$this->assertSame(12, Category::count());
$this->assertSame(26, Tag::count());
$this->assertSame(24, Post::count());
$this->assertSame(14, Category::count());
$this->assertSame(32, Tag::count());
$this->assertSame(36, Post::count());
$post = Post::where('slug', 'core-web-vitals-practical-guide')->firstOrFail();
$this->assertSame($user->id, $post->author_id);
@@ -40,16 +40,27 @@ class RealBlogContentSeederTest extends TestCase
$faTwin = Post::where('slug', 'core-web-vitals-practical-guide-fa')->firstOrFail();
$this->assertNotNull($faTwin->published_at);
// Strict English/Persian mirror: the two versions always cover exactly
// the same topics, so no post exists in only one language.
// Every English post and every new topic pair resolve their Persian twin:
// the strict English/Persian mirror now spans 18 posts per language.
$englishCount = Post::where('slug', 'not like', '%-fa')->count();
$persianCount = Post::where('slug', 'like', '%-fa')->count();
$this->assertSame($englishCount, $persianCount);
$this->assertSame(18, $englishCount);
foreach (Post::where('slug', 'not like', '%-fa')->pluck('slug') as $slug) {
$this->assertDatabaseHas('posts', ['slug' => $slug.'-fa']);
}
// Deepened editing: every article ends with Key takeaways + FAQ sections
// in both languages, plus the new engineering-practices category pair.
foreach (Post::pluck('body') as $body) {
$this->assertStringContainsString('## FAQ', $body);
}
$this->assertDatabaseHas('categories', ['slug' => 'engineering-practices']);
$this->assertDatabaseHas('categories', ['slug' => 'engineering-practices-fa']);
$this->assertDatabaseHas('posts', ['slug' => 'typescript-advanced-patterns']);
$this->assertDatabaseHas('posts', ['slug' => 'typescript-advanced-patterns-fa']);
// featured_image is a VARCHAR(255) column; the generated og-image URLs
// must never overrun it, or the seeder fails in production.
foreach (Post::pluck('featured_image') as $image) {
@@ -71,8 +82,8 @@ class RealBlogContentSeederTest extends TestCase
$this->seed(RealBlogContentSeeder::class);
$this->seed(RealBlogContentSeeder::class);
$this->assertSame(12, Category::count());
$this->assertSame(26, Tag::count());
$this->assertSame(24, Post::count());
$this->assertSame(14, Category::count());
$this->assertSame(32, Tag::count());
$this->assertSame(36, Post::count());
}
}