A free open source IT asset/license management system
Merge branch 'develop' into features/18554-component-report
Marcus Moore4a7f9ea9c53e
diff --cc tests/Support/CustomTestMacros.phpindex 6b3072b5ed,89fc3b0928..4068d5e164--- a/tests/Support/CustomTestMacros.php+++ b/tests/Support/CustomTestMacros.php@@@ -190,6 -190,48 +190,48 @@@ trait CustomTestMacro});+ /**+ * Assert that the streamed CSV response contains a row where all given header→value pairs match simultaneously.+ *+ * The first row of the CSV is treated as headers. Each subsequent row is combined with those headers+ * to produce an associative map, and the assertion passes if at least one row satisfies every pair.+ *+ * Unlike assertSeeTextInStreamedResponse, this verifies that the values appear together in the same+ * row under the correct column — not just anywhere in the file.+ *+ * Usage:+ * ->assertSeePairsInStreamedResponse([+ * 'First Name' => 'Luke',+ * 'Last Name' => 'Skywalker',+ * 'Username' => 'lskywalker',+ * ])+ */+ TestResponse::macro(+ 'assertSeePairsInStreamedResponse',+ function (array $pair): self {+ $records = collect(Reader::createFromString($this->streamedContent())->getRecords());++ $headers = collect($records->shift());+- $combined = $records->map(fn ($record) => $headers->combine($record));++ $combined = $records->map(fn($record) => $headers->combine($record));++ Assert::assertTrue(+ $combined->contains(function ($row) use ($pair) {+ foreach ($pair as $key => $value) {+ if (($row[$key] ?? null) !== $value) {+ return false;+ }+ }++ return true;+ }),+ 'Response did not contain a row matching the expected pairs: '.json_encode($pair)+ );++ return $this;+ }+ );+TestResponse::macro('assertCsvHeader',function () {