feat: ship creator journey v2 and profile updates
This commit is contained in:
37
tests/Unit/CategoriesSitemapBuilderTest.php
Normal file
37
tests/Unit/CategoriesSitemapBuilderTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use App\Services\Sitemaps\Builders\CategoriesSitemapBuilder;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
uses(Tests\TestCase::class, RefreshDatabase::class);
|
||||
|
||||
it('builds category sitemap entries from dynamic content types', function () {
|
||||
$contentTypeId = DB::table('content_types')->insertGetId([
|
||||
'name' => 'Pixel Art',
|
||||
'slug' => 'pixel-art',
|
||||
'description' => 'Pixel art uploads',
|
||||
'order' => 1,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
DB::table('categories')->insert([
|
||||
'content_type_id' => $contentTypeId,
|
||||
'parent_id' => null,
|
||||
'name' => 'Characters',
|
||||
'slug' => 'characters',
|
||||
'description' => null,
|
||||
'image' => null,
|
||||
'is_active' => true,
|
||||
'sort_order' => 1,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
$items = app(CategoriesSitemapBuilder::class)->items();
|
||||
$locations = array_map(static fn ($item) => $item->loc, $items);
|
||||
|
||||
expect($locations)->toContain(url('/pixel-art'))
|
||||
->and($locations)->toContain(url('/pixel-art/characters'));
|
||||
});
|
||||
Reference in New Issue
Block a user