27 lines
704 B
PHP
27 lines
704 B
PHP
<?php
|
|
|
|
namespace Tests\Unit\Resources\Ui;
|
|
|
|
use App\Http\Resources\Ui\UiStyleResource;
|
|
use App\Models\Preferences;
|
|
use Tests\TestCase;
|
|
|
|
class UiStyleResourceTest extends TestCase
|
|
{
|
|
public function test_resource_returns_expected_shape(): void
|
|
{
|
|
$prefs = new Preferences([
|
|
'style_color' => 'blue',
|
|
'menu_color' => 'custom',
|
|
'menu_custom_bg' => '#112233',
|
|
'menu_custom_text' => '#FFFFFF',
|
|
'menu_custom_mode' => 'dark',
|
|
]);
|
|
|
|
$payload = (new UiStyleResource($prefs))->toArray(request());
|
|
|
|
$this->assertSame('blue', $payload['style_color']);
|
|
$this->assertSame('custom', $payload['menu_color']);
|
|
}
|
|
}
|