refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s

This commit is contained in:
Kroonk
2026-05-22 16:19:55 +02:00
parent 38cc4c09ca
commit a213a1dba0
2215 changed files with 242567 additions and 6015 deletions

View File

@@ -0,0 +1,54 @@
<?php
namespace Tests\Unit\Jobs;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ServiceQueueTest extends TestCase
{
use DatabaseTransactions;
/** @test */
public function it_run_a_service_ok(): void
{
config(['queue.default' => 'sync']);
ServiceQueueTester::dispatch();
$this->assertTrue(ServiceQueueTester::$executed);
$this->assertFalse(ServiceQueueTester::$failed);
}
/** @test */
public function it_run_a_service_sync(): void
{
ServiceQueueTester::dispatchSync();
$this->assertTrue(ServiceQueueTester::$executed);
$this->assertFalse(ServiceQueueTester::$failed);
}
/** @test */
public function it_run_a_service_which_failed(): void
{
$this->expectException(\Exception::class);
try {
ServiceQueueTester::dispatchSync(['throw' => true]);
} finally {
$this->assertTrue(ServiceQueueTester::$executed);
$this->assertTrue(ServiceQueueTester::$failed);
}
}
/** @test */
public function service_is_not_run_if_queue_set(): void
{
config(['queue.default' => 'database']);
ServiceQueueTester::dispatch(['throw' => true]);
$this->assertFalse(ServiceQueueTester::$executed);
$this->assertFalse(ServiceQueueTester::$failed);
}
}