12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
5b8bdf4182
779 changed files with 480564 additions and 6241 deletions
26
tests/Feature/Categories/CategorySeederTest.php
Normal file
26
tests/Feature/Categories/CategorySeederTest.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Category;
|
||||
use Database\Seeders\CategorySeeder;
|
||||
use Tests\TestCase;
|
||||
|
||||
test('category seeder creates multilingual categories', function () {
|
||||
/** @var TestCase $this */
|
||||
$this->seed(CategorySeeder::class);
|
||||
|
||||
$business = Category::query()
|
||||
->whereHas('translations', function ($query) {
|
||||
$query->where('locale', 'de')->where('slug', 'wirtschaft');
|
||||
})
|
||||
->firstOrFail();
|
||||
|
||||
expect($business->translations()->count())->toBe(2);
|
||||
});
|
||||
|
||||
test('category seeder is idempotent for seeded slugs', function () {
|
||||
/** @var TestCase $this */
|
||||
$this->seed(CategorySeeder::class);
|
||||
$this->seed(CategorySeeder::class);
|
||||
|
||||
expect(Category::query()->count())->toBe(3);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue