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

@@ -5,6 +5,7 @@ namespace MintyPHP\Repository\Audit;
use MintyPHP\DB;
use MintyPHP\Domain\Taxonomy\ImportAuditStatus;
use MintyPHP\Repository\Support\RepoQuery;
use MintyPHP\Repository\Support\RepositoryArrayHelper;
/** Tracks CSV import runs including source file, row counts, status, and completion metadata. */
class ImportAuditRunRepository implements ImportAuditRunRepositoryInterface
@@ -202,7 +203,7 @@ class ImportAuditRunRepository implements ImportAuditRunRepositoryInterface
$users = [];
if (is_array($userRows)) {
foreach ($userRows as $row) {
$flat = self::flattenRow($row);
$flat = RepositoryArrayHelper::flattenRow($row);
$id = (int) ($flat['user_id'] ?? 0);
if ($id <= 0) {
continue;
@@ -298,24 +299,4 @@ class ImportAuditRunRepository implements ImportAuditRunRepositoryInterface
return $item;
}
/**
* @return array<string, mixed>
*/
private static function flattenRow(mixed $row): array
{
if (!is_array($row)) {
return [];
}
$flat = [];
foreach ($row as $key => $value) {
if (is_array($value)) {
$flat = array_merge($flat, $value);
} elseif (is_string($key)) {
$flat[$key] = $value;
}
}
return $flat;
}
}