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: dawonefr-98 (1071)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /home/hasdeuac-119/has.deu.ac.kr/tests/TestCase.php
<?php

namespace Tests;

use App\Actions\CreateTenantAction;
use App\Models\Central\Tenant;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Support\Str;

abstract class TestCase extends BaseTestCase
{
    use CreatesApplication;

    /**
     * Most tests don't need this. Unless they test the billing page.
     *
     * @var bool
     */
    protected $createStripeCustomer = false;

    protected function setUp(): void
    {
        parent::setUp();

        config(['tenancy.database.prefix' => 'test_tenant']);
    }

    protected function createTenant(array $data = [], string $domain = null, bool $createStriperCustomer = null): Tenant
    {
        $domain = $domain ?? Str::random('10');

        return (new CreateTenantAction)(array_merge([
            'company' => 'Foo company',
            'name' => 'John Doe',
            'email' => 'foo@tenant.localhost',
            'password' => bcrypt('password'),
        ], $data), $domain, $createStriperCustomer ?? $this->createStripeCustomer);
    }
}