940afe9319
API CI/CD / Validate (composer + pint) (push) Successful in 2m7s
API CI/CD / Test (PHPUnit) (push) Failing after 2m23s
API CI/CD / Build frontend assets (push) Successful in 2m18s
API CI/CD / Security audit (push) Successful in 31s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature\Api\V1\Frontend;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Laravel\Sanctum\Sanctum;
|
|
use Tests\TestCase;
|
|
|
|
class InfoIconControllerTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_profile_icon_returns_initials(): void
|
|
{
|
|
$user = User::query()->create([
|
|
'firstname' => 'John',
|
|
'lastname' => 'Doe',
|
|
'email' => 'john@example.com',
|
|
'cellphone' => '5555555555',
|
|
'address_street' => '123 Main',
|
|
'city' => 'City',
|
|
'state' => 'ST',
|
|
'zip' => '12345',
|
|
'accept_school_policy' => 1,
|
|
'status' => 'Active',
|
|
'password' => bcrypt('secret'),
|
|
'semester' => 'Fall',
|
|
'school_year' => '2025-2026',
|
|
]);
|
|
|
|
$this->actingAs($user, 'api');
|
|
Sanctum::actingAs($user);
|
|
|
|
$response = $this->getJson('/api/v1/info-icon/profile');
|
|
|
|
$response->assertOk();
|
|
$response->assertJsonPath('data.profile.user_initials', 'JD');
|
|
}
|
|
}
|