mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-04 10:42:23 +00:00
Remove tests that copy app logic into the test, grep PHP source as text, only check literals, constants, class_exists or PHP built-ins, duplicate other tests, or are always skipped. Keep source checks that guard security and authorization rules. Rename a duplicate Pest helper so the full suite loads, drop the missing v5/Browser path, and remove the CLAUDE.md symlink in favor of AGENTS.md. Correct AGENTS.md: Dusk is not installed and the upgrade script is scripts/upgrade.sh.
29 lines
788 B
PHP
29 lines
788 B
PHP
<?php
|
|
|
|
use App\Events\DatabaseStatusChanged;
|
|
use App\Jobs\DatabaseStartJob;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Support\Facades\Event;
|
|
use Tests\TestCase;
|
|
|
|
uses(TestCase::class, RefreshDatabase::class);
|
|
|
|
it('broadcasts failed database starts to the initiating user even when the activity is missing', function () {
|
|
Event::fake([DatabaseStatusChanged::class]);
|
|
|
|
$job = new DatabaseStartJob(
|
|
databaseClass: 'MissingDatabase',
|
|
databaseId: 123,
|
|
teamId: 456,
|
|
activityId: 789,
|
|
userId: 42,
|
|
);
|
|
|
|
$job->failed(new RuntimeException('Database start failed.'));
|
|
|
|
Event::assertDispatched(
|
|
DatabaseStatusChanged::class,
|
|
fn (DatabaseStatusChanged $event): bool => $event->userId === 42,
|
|
);
|
|
});
|