HEX
Server: nginx/1.28.3
System: Linux lightweb-s1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User: drdrivek-71 (1047)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /home/eslinced-103/brise-edu.or.kr/tests/Feature/Central/TenantAdminTest.php
<?php

namespace Tests\Feature\Central;

use App\Models\Central\Tenant;
use App\Models\User;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use PHPUnit\Framework\Attributes\Test;
use Tests\TestCase;

final class TenantAdminTest extends TestCase
{
    use DatabaseMigrations;

    #[Test]
    public function updating_tenant_admins_email_changes_the_email_in_the_tenant_too(): void
    {
        $tenant = Tenant::create([
            'name' => 'Super Admin',
            'email' => 'foo@admin',
            'password' => 'password',
        ]);

        $tenant->run(function () {
            User::first()->update([
                'email' => 'bar@email',
            ]);
        });

        $this->assertSame('bar@email', Tenant::first()->email);
    }
}