From 53a784bbe872ecf6ffba74ee537081543fef7726 Mon Sep 17 00:00:00 2001 From: Vladimir Bryzgalov Date: Tue, 12 May 2026 17:36:26 +0500 Subject: [PATCH] feat(wpmc S2): Taxonomy::register() attaches init hook Co-Authored-By: Claude Sonnet 4.6 --- includes/class-taxonomy.php | 19 ++++++++++++++++ tests/TaxonomyTest.php | 43 +++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 includes/class-taxonomy.php create mode 100644 tests/TaxonomyTest.php diff --git a/includes/class-taxonomy.php b/includes/class-taxonomy.php new file mode 100644 index 0000000..f712922 --- /dev/null +++ b/includes/class-taxonomy.php @@ -0,0 +1,19 @@ +once() + ->with('town', ['shortcode-town'], \Mockery::on(function ($args) use (&$captured) { + $captured = $args; + return true; + })); + + Taxonomy::do_register(); + + self::assertFalse($captured['hierarchical'], 'town must be flat'); + self::assertFalse($captured['public'], 'town must not be public'); + self::assertTrue($captured['show_ui'], 'town must show in admin UI'); + self::assertTrue($captured['show_in_rest'], 'town must be REST-exposed'); + self::assertFalse($captured['publicly_queryable']); + self::assertFalse($captured['query_var']); + self::assertFalse($captured['rewrite']); + self::assertFalse($captured['meta_box_cb']); + self::assertSame('Города', $captured['labels']['name']); + } +}