changes to translation system
Some checks failed
PHPUnit / test (push) Has been cancelled

This commit is contained in:
tom.hempel
2026-07-09 14:59:56 +02:00
parent 4afab336ee
commit f04388e0ec
24 changed files with 1882 additions and 415 deletions

View File

@ -27,7 +27,7 @@ final class AssignmentsActivityLogTest extends QdbTestCase
DatabaseSeeder::ADMIN_USERNAME,
DatabaseSeeder::PASSWORD
)['token'];
$today = gmdate('Y-m-d');
$today = date('Y-m-d');
$res = $this->api()->withToken($token, 'GET', 'activity-log', null, [
'date' => $today,
'limit' => '50',

View File

@ -91,6 +91,43 @@ final class ClientsLifecycleTest extends QdbTestCase
$this->assertContains($code, array_column($activeAgain['data']['clients'], 'clientCode'));
}
public function testAdminResetsClient(): void
{
$this->submitFixtureQuestionnaire();
$token = $this->api()->loginWebAndGetToken(
DatabaseSeeder::ADMIN_USERNAME,
DatabaseSeeder::PASSWORD
)['token'];
$code = $this->fixture()->clientCode;
$reset = $this->api()->withToken($token, 'POST', 'clients', [
'action' => 'reset',
'clientCode' => $code,
]);
$this->assertApiOk($reset);
$this->assertTrue($reset['data']['reset'] ?? false);
$detail = $this->api()->withToken($token, 'GET', 'clients', null, [
'clientCode' => $code,
'detail' => '1',
]);
$this->assertApiOk($detail);
$this->assertSame($code, $detail['data']['client']['clientCode'] ?? '');
$this->assertSame([], $detail['data']['questionnaires'] ?? null);
$list = $this->api()->withToken($token, 'GET', 'clients');
$this->assertApiOk($list);
$row = null;
foreach ($list['data']['clients'] as $client) {
if (($client['clientCode'] ?? '') === $code) {
$row = $client;
break;
}
}
$this->assertNotNull($row);
$this->assertSame(0, (int)($row['hasResponseData'] ?? 1));
}
public function testAdminDeletesClient(): void
{
$token = $this->api()->loginWebAndGetToken(