Repository navigation
test: raise the coverage to 98.8 % - #12
Merged
Merged
Conversation
added 2 commits
November 13, 2026 20:01
…nomy and the standard registration fallbacks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Raises the coverage of the package from 54.2 % to 98.8 %, with tests only (
src/is untouched).184 test cases in four files (the suite goes from 77 to 261): every fluent accessor of
Entity,PostTypeandTaxonomykeeps its value and stays chainable (datasets), and the fallbacks toregister_post_type/register_taxonomy.Entity,PostTypeandTaxonomyare at 100 %. Intests/Helpers/helpers.phpthe globalregister_post_typeandregister_taxonomystand-ins now also record their calls in$GLOBALS['entity_test_registrations'](four lines added, none removed; no other test reads it).Not covered:
PostTypeRegistryAdapter(83.3 %: lines 44, 51, 65) andTaxonomyRegistryAdapter(88.9 %: lines 53, 68), the branches taken when the WordPress or Extended CPTs registration functions do not exist. A global function cannot be removed in a running process, andjohnbillion/extended-cptsdefines its own through the Composer autoload.Seen in the code and left as it is:
TaxonomyRegistryAdapter::register()doesunset($args['object_type'])after callingregisterTaxonomy, which has no effect ($argsis not used again), and a call withoutobject_typeis ignored without an error or a message (a test pins it).Entity::showInMenu()has no return type, unlike its neighbours (: self).composer phpstanscript analysesteststoo and reports 57 errors that are already onmain(deprecated calls in the existing tests); the CI usesphpstan.neon(srconly), which is clean.The coverage ratchet in
.harness.jsongoes from 54.23 to 98. Measured withpest --coverage(PHP 8.4, pcov, the CI driver); the 261 tests pass in random orders; Pint, PHPStan, Rector (--dry-run) andtests/Arch.phpare clean.