CaiWuXiTong/tests/Feature/Installation/ApplicationReadyTest.php

38 lines
1.2 KiB
PHP

<?php
namespace Tests\Feature\Installation;
use Tests\TestCase;
class ApplicationReadyTest extends TestCase
{
public function test_ready_command_requires_installed_application_and_database_connection(): void
{
config(['app.installed' => true]);
$this->artisan('app:ready')->assertSuccessful();
}
public function test_ready_command_rejects_uninstalled_application(): void
{
config(['app.installed' => false]);
$this->artisan('app:ready')
->assertExitCode(\App\Console\Commands\ApplicationReady::EXIT_NOT_INSTALLED);
}
public function test_bootstrap_stays_healthy_without_claiming_shared_data_is_ready(): void
{
config(['app.installed' => true, 'system_database.mode' => 'bootstrap']);
$this->artisan('app:ready')
->expectsOutputToContain('团队共享数据尚未接入')
->assertSuccessful();
}
public function test_shared_application_health_does_not_claim_upstream_sync_success(): void
{
config(['app.installed' => true, 'system_database.mode' => 'shared']);
$this->artisan('app:ready')
->expectsOutputToContain('团队数据接入状态请运行 system-database:verify')
->assertSuccessful();
}
}