test(dossier): split DossierMenuRegistrationTest (551→235+198+120 lines, P1 fix) + §22c→§22b (P3 fix)
P1: DossierMenuRegistrationTest.php was 551 lines (cap 300). Split into:
- DossierMenuRegistrationTestCase.php (120 lines): shared Brain\Monkey harness,
add_submenu_page spy stub, $submenu isolation — abstract base class.
- DossierMenuRegistrationTest.php (235 lines): structural invariants (parent slug,
$submenu non-mutation, page slug constant, asset enqueue gate prefix), deep-link
URL shape, and hook priority ordering — 7 test methods.
- DossierHooknameMechanismTest.php (198 lines): request-time hookname faithfulness
(simulate_request_time_hookname discriminator) and regression proof — 2 test methods.
Method inventory parity: 9 before = 9 after.
Before: test_request_time_hookname_matches_registration_hookname,
test_hide_by_unset_would_fail_request_time_check,
test_dossier_parent_slug_is_options_php, test_no_submenu_mutation_after_registration,
test_dossier_uses_correct_slug, test_asset_enqueue_gate_uses_admin_page_prefix,
test_url_for_post_contains_slug_and_post_id, test_url_for_post_exact_shape,
test_dossier_hook_registered_at_priority_12.
After: same 9, split 7/2 across two files. Zero assertions dropped.
P3: class-dossier-page.php docblock §22c → §22b (two occurrences).
No §22c heading exists in ARCHITECTURE.md; convention content is in §22b.
Agent-Session: dossier-403-hotfix-20260612
This commit is contained in:
@@ -19,7 +19,7 @@ declare(strict_types=1);
|
||||
* → at request time get_admin_page_parent() no longer finds the slug in $submenu
|
||||
* → WP recomputes hookname in the 'admin_page_*' orphan namespace
|
||||
* → no callback registered there → wp_die(403).
|
||||
* See ARCHITECTURE.md §22c + CONVENTIONS.md §Hidden Admin Pages for the full incident
|
||||
* See ARCHITECTURE.md §22b + CONVENTIONS.md §Hidden Admin Pages for the full incident
|
||||
* history (board 404 v0.19.1, dossier 403 v0.19.2).
|
||||
*
|
||||
* Board cards and post-metabox deep-link here via
|
||||
@@ -34,7 +34,7 @@ declare(strict_types=1);
|
||||
*
|
||||
* @see admin/class-dossier-data-assembler.php -- Builds the view model.
|
||||
* @see templates/admin/dossier-page.php -- HTML template.
|
||||
* @see ARCHITECTURE.md -- §22c (hidden admin page convention).
|
||||
* @see ARCHITECTURE.md -- §22b (hidden admin page convention).
|
||||
* @see CONVENTIONS.md -- §Hidden Admin Pages.
|
||||
*/
|
||||
class PRAutoBlogger_Dossier_Page {
|
||||
|
||||
Reference in New Issue
Block a user