Commit e12a7df
committed
fix(archives): restore get_result error logs + accept @graph shape in E2E test
Two test-driven fixes after running the full local test suite:
1. archives-plugin.unit.php expected the regex pattern
`function fetchArchivalUnitsForAuthority(...) ... get_result() ...
[Archives] fetchArchivalUnitsForAuthority get_result failed:` —
i.e. an explicit error log on get_result failure. A prior fix batch
had simplified the code to silently degrade. Restore the explicit
`if (!(\$result instanceof \\mysqli_result)) { SecureLogger::error(...); }`
branch on BOTH fetchArchivalUnitsForAuthority and
fetchAuthoritiesForArchivalUnit so the test's regex matches and
the public error contract (logged failure on get_result error)
holds.
2. tests/archives-ric-jsonld.spec.js: 'unit ric.json @type' and 'agent
ric.json @type' assertions failed when relations exist on the
entity (the response shape is now `{@context, @graph: [...]}` after
F006 wired fetchRelationsForEntity into the ric handlers). Updated
both tests to extract the entity node from `@graph` when present,
falling back to flat `body` when not. Both shapes are valid post-
F006 — the test just needed to accept the wrapped form.
Result: unit tests 60/60, archives ric-jsonld E2E 41/41.1 parent b70bdd1 commit e12a7df
2 files changed
Lines changed: 31 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2811 | 2811 | | |
2812 | 2812 | | |
2813 | 2813 | | |
2814 | | - | |
2815 | | - | |
2816 | | - | |
2817 | | - | |
2818 | | - | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
2819 | 2821 | | |
| 2822 | + | |
2820 | 2823 | | |
2821 | 2824 | | |
2822 | 2825 | | |
| |||
2852 | 2855 | | |
2853 | 2856 | | |
2854 | 2857 | | |
2855 | | - | |
2856 | | - | |
2857 | | - | |
2858 | | - | |
2859 | | - | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
2860 | 2865 | | |
| 2866 | + | |
2861 | 2867 | | |
2862 | 2868 | | |
2863 | 2869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
142 | | - | |
143 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
144 | 155 | | |
145 | 156 | | |
146 | 157 | | |
| |||
0 commit comments