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,48 @@
<?php
namespace Tests\Api;
use Tests\ApiTestCase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ApiStatisticsControllerTest extends ApiTestCase
{
use DatabaseTransactions;
protected $jsonStructure = [
'instance_creation_date',
'number_of_contacts',
'number_of_users',
'number_of_activities',
'number_of_reminders',
'number_of_new_users_last_week',
];
/** @test */
public function it_gets_the_right_structure_of_the_public_statistics()
{
config(['monica.allow_statistics_through_public_api_access' => true]);
$user = $this->signin();
$response = $this->json('GET', '/api/statistics');
$response->assertStatus(200);
$response->assertJsonStructure([
$this->jsonStructure,
]);
}
/** @test */
public function it_returns_an_error_if_public_statistics_are_not_available()
{
config(['monica.allow_statistics_through_public_api_access' => false]);
$user = $this->signin();
$response = $this->json('GET', '/api/statistics');
$this->expectNotFound($response);
}
}