refactor(tests): remove redundant tests and fix assertion style

Remove subset/duplicate architecture tests already covered by broader
checks, and replace assertTrue(true) with self::addToAssertionCount(1)
for explicit no-exception-thrown intent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 18:46:49 +01:00
parent cb5f7037b2
commit c609753570
19 changed files with 111 additions and 284 deletions

View File

@@ -161,4 +161,42 @@ class RepositoryArrayHelperTest extends TestCase
$this->assertSame([5], $result);
$this->assertSame(0, array_key_first($result));
}
// --- flattenRow ---
public function testFlattenRowMergesNestedTableArrays(): void
{
$row = [
'api_audit_log' => ['id' => 1, 'request_id' => 'abc'],
'users' => ['display_name' => 'Alice'],
'tenants' => ['description' => 'Tenant A'],
];
$this->assertSame(
[
'id' => 1,
'request_id' => 'abc',
'display_name' => 'Alice',
'description' => 'Tenant A',
],
RepositoryArrayHelper::flattenRow($row)
);
}
public function testFlattenRowKeepsTopLevelScalarValues(): void
{
$row = [
'status' => 'ok',
'count' => 3,
];
$this->assertSame(['status' => 'ok', 'count' => 3], RepositoryArrayHelper::flattenRow($row));
}
public function testFlattenRowReturnsEmptyForNonArray(): void
{
$this->assertSame([], RepositoryArrayHelper::flattenRow(null));
$this->assertSame([], RepositoryArrayHelper::flattenRow(false));
$this->assertSame([], RepositoryArrayHelper::flattenRow('text'));
}
}