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,62 @@
<?php
namespace Tests\Unit\Services\DavClient;
use Tests\TestCase;
use Mockery\MockInterface;
use App\Models\Account\AddressBookSubscription;
use App\Services\DavClient\SynchronizeAddressBook;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use App\Services\DavClient\Utils\AddressBookSynchronizer;
class SynchronizeAddressBookTest extends TestCase
{
use DatabaseTransactions;
/** @test */
public function it_runs_sync()
{
$this->mock(AddressBookSynchronizer::class, function (MockInterface $mock) {
$mock->shouldReceive('execute')
->once()
->withArgs(function ($sync, $force) {
$this->assertFalse($force);
return true;
});
});
$subscription = AddressBookSubscription::factory()->create();
$request = [
'account_id' => $subscription->account_id,
'addressbook_subscription_id' => $subscription->id,
];
(new SynchronizeAddressBook())->execute($request);
}
/** @test */
public function it_runs_sync_force()
{
$this->mock(AddressBookSynchronizer::class, function (MockInterface $mock) {
$mock->shouldReceive('execute')
->once()
->withArgs(function ($sync, $force) {
$this->assertTrue($force);
return true;
});
});
$subscription = AddressBookSubscription::factory()->create();
$request = [
'account_id' => $subscription->account_id,
'addressbook_subscription_id' => $subscription->id,
'force' => true,
];
(new SynchronizeAddressBook())->execute($request);
}
}