Repository navigation
[6.x] Add the missing Test attribute to five tests that never ran - #15758
Open
dylanpulver wants to merge 1 commit into
Open
dylanpulver wants to merge 1 commit into
dylanpulver wants to merge 1 commit into
Conversation
Statamic names its tests in snake_case and marks each one with `#[Test]`. Five methods assert but carry no attribute, so PHPUnit never collects them. Two of the five are halves of a matched pair, which is what makes the omission plain: - `AssetQueryBuilderTest::assets_are_found_using_where_null` has no attribute while `assets_are_found_using_where_not_null` directly below it has one. - `EntryQueryBuilderTest::entries_are_found_using_where_null` has no attribute while `entries_are_found_using_where_not_null` directly below it has one. So `whereNull` had no coverage on either query builder while `whereNotNull` did. The other three are `AddonTest::it_gets_the_autoloaded_directory`, `UserGroupTest::it_adds_a_role_using_handle` and `TemplateFieldtypeScaffoldingTest::it_scaffolds_nested_template_fieldtype_blade`. All five pass as written, so nothing beyond the attribute needed touching. Per file, tests and assertions before and after: AddonTest 32/62 -> 33/63 UserGroupTest 19/62 -> 20/64 AssetQueryBuilderTest 43/123 -> 44/125 EntryQueryBuilderTest 109/266 -> 110/268 TemplateFieldtypeScaffoldingTest 3/3 -> 4/4 Pint reports PASS on all five files.
This branch has not been deployed
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.
Statamic names its tests in snake_case and marks each one with
#[Test]. Five methods assert but carry no attribute, so PHPUnit never collects them and they have never run.Two of the five are halves of a matched pair, which is what makes the omission plain:
AssetQueryBuilderTest::assets_are_found_using_where_nullAssetQueryBuilderTest::assets_are_found_using_where_not_nullEntryQueryBuilderTest::entries_are_found_using_where_nullEntryQueryBuilderTest::entries_are_found_using_where_not_nullSo
whereNullhad no coverage on either query builder whilewhereNotNulldid. The other three areAddonTest::it_gets_the_autoloaded_directory,UserGroupTest::it_adds_a_role_using_handleandTemplateFieldtypeScaffoldingTest::it_scaffolds_nested_template_fieldtype_blade.All five pass as written, so nothing beyond the attribute needed touching. Per file, before and after:
vendor/bin/pint --testreports PASS on all five files.To answer question 2 in the template: yes, AI tools were used. Found with a static check for PHPUnit methods that assert but cannot be collected, and written with Claude Code. The counts above are from running each file before and after, and the matched-pair asymmetry was confirmed by reading the surrounding methods rather than inferred.