Skip to content

Consolidate shared test fixtures and cover nested deferred callbacks - #624

Merged
binaryfire merged 1 commit into
0.4from
upstream-sync-framework-03
Sep 28, 2026
Merged

binaryfire merged 1 commit into
0.4from
upstream-sync-framework-03

Conversation

@binaryfire

@binaryfire binaryfire commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Laravel Updates

  • #61422 — Consolidate shared test fixtures for database models, routing controllers and enums, mail, notifications, queued jobs and model inspection. Update imports and fixture paths so tests use the shared definitions while retaining Hypervel's typing and test isolation.
  • #61431 — Add the HTTP regression test for callbacks deferred from inside another deferred callback. Hypervel already drains those callbacks; this verifies that behavior through request termination.

Additional Hypervel Fixes

  • Update additional consumers of the moved fixtures, including redirect tests and named scopes. Reuse the shared models in the ignoring-touch assertions while keeping the richer relationship models local to their test file.

This changes tests and fixtures only. The full parallel suite, affected MySQL and MariaDB tests, formatting, and source and type analysis pass.

Review in cubic

Summary by CodeRabbit

  • Tests
    • Consolidated shared test fixtures.
    • Added coverage for callbacks deferred from within other deferred callbacks.
    • Updated integration test coverage across database, routing, mail, notification, and queue scenarios.

Move common database models, routing controllers, enums and route files into their shared fixture locations, and extract mail, notification, queue and model-inspector helpers. Update consumers without changing runtime behavior or dropping Hypervel-specific assertions and isolation adaptations.

Reuse the shared models for ignoring-touch assertions while keeping the richer relationship fixtures local. Preserve native typing, immutable dates and the existing timestamp-mutator correction. Add the upstream HTTP regression for callbacks deferred within another callback; the recursive runtime drain is already present.

Port Laravel framework laravel/framework#61422 and the regression from laravel/framework#61431 against master 7068848dfe48fc3a433598e09ce798799d442a52.

Validated affected test files individually, MySQL and MariaDB timestamp casts, MySQL after-commit transaction coverage, the full parallel suite, formatting and both PHPStan configurations.
@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: hypervel/components/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 4e9355c5-95f4-475e-bd3c-38419f9ba218

📥 Commits

Reviewing files that changed from the base of the PR and between 3dd04b2 and d7ae720.

📒 Files selected for processing (77)
  • tests/Database/DatabaseEloquentIntegrationTest.php
  • tests/Database/Fixtures/Models/Attachment.php
  • tests/Database/Fixtures/Models/Comment.php
  • tests/Database/Fixtures/Models/Guarded/Post.php
  • tests/Database/Fixtures/Models/IntTimestampCasts/UnixTimeStampToCarbon.php
  • tests/Database/Fixtures/Models/IntTimestampCasts/UserWithIntTimestampsViaAttribute.php
  • tests/Database/Fixtures/Models/IntTimestampCasts/UserWithIntTimestampsViaCasts.php
  • tests/Database/Fixtures/Models/IntTimestampCasts/UserWithIntTimestampsViaMutator.php
  • tests/Database/Fixtures/Models/IntTimestampCasts/UserWithUpdatedAtViaMutator.php
  • tests/Database/Fixtures/Models/Integration/Post.php
  • tests/Database/Fixtures/Models/Integration/User.php
  • tests/Database/Fixtures/Models/LoadAggregate/BaseModel.php
  • tests/Database/Fixtures/Models/LoadAggregate/Related1.php
  • tests/Database/Fixtures/Models/LoadAggregate/Related2.php
  • tests/Database/Fixtures/Models/MorphEagerLoading/User.php
  • tests/Database/Fixtures/Models/MorphEagerLoading/Video.php
  • tests/Database/Fixtures/Models/MorphToTarget/Post.php
  • tests/Database/Fixtures/Models/PostLikes/Like.php
  • tests/Database/Fixtures/Models/PostLikes/Post.php
  • tests/Integration/Database/EloquentCollectionFreshTest.php
  • tests/Integration/Database/EloquentDeleteTest.php
  • tests/Integration/Database/EloquentEagerLoadingLimitTest.php
  • tests/Integration/Database/EloquentHasOneIsTest.php
  • tests/Integration/Database/EloquentModelLoadMaxTest.php
  • tests/Integration/Database/EloquentModelLoadMinTest.php
  • tests/Integration/Database/EloquentModelLoadSumTest.php
  • tests/Integration/Database/EloquentMorphConstrainTest.php
  • tests/Integration/Database/EloquentMorphCountEagerLoadingTest.php
  • tests/Integration/Database/EloquentMorphCountLazyEagerLoadingTest.php
  • tests/Integration/Database/EloquentMorphEagerLoadingTest.php
  • tests/Integration/Database/EloquentMorphLazyEagerLoadingTest.php
  • tests/Integration/Database/EloquentMorphOneIsTest.php
  • tests/Integration/Database/EloquentMorphToEagerLoadTest.php
  • tests/Integration/Database/EloquentMorphToGlobalScopesTest.php
  • tests/Integration/Database/EloquentMorphToIsTest.php
  • tests/Integration/Database/EloquentMorphToLazyEagerLoadingTest.php
  • tests/Integration/Database/EloquentMorphToSelectTest.php
  • tests/Integration/Database/EloquentMorphToTouchesTest.php
  • tests/Integration/Database/EloquentPaginateTest.php
  • tests/Integration/Database/EloquentTransactionWithAfterCommitTests.php
  • tests/Integration/Database/EloquentWhereHasTest.php
  • tests/Integration/Database/Fixtures/NamedScopeUser.php
  • tests/Integration/Database/MariaDb/EloquentCastTest.php
  • tests/Integration/Database/ModelInspectorTest.php
  • tests/Integration/Database/MySql/EloquentCastTest.php
  • tests/Integration/Http/Fixtures/ModelInspectorTestModelResource.php
  • tests/Integration/Mail/SentMessageMailTest.php
  • tests/Integration/Notifications/SendingNotificationsWithLocaleTest.php
  • tests/Integration/Queue/DeleteNotificationWhenMissingModelTest.php
  • tests/Integration/Routing/Fixtures/ApiResourceTaskController.php
  • tests/Integration/Routing/Fixtures/ApiResourceTestController.php
  • tests/Integration/Routing/Fixtures/CreatableSingletonTestController.php
  • tests/Integration/Routing/Fixtures/NestedSingletonTestController.php
  • tests/Integration/Routing/Fixtures/SingletonTestController.php
  • tests/Integration/Routing/ImplicitBackedEnumRouteBindingTest.php
  • tests/Integration/Routing/RouteApiResourceTest.php
  • tests/Integration/Routing/RouteCachingTest.php
  • tests/Integration/Routing/RouteCanBackedEnumTest.php
  • tests/Integration/Routing/RouteRedirectTest.php
  • tests/Integration/Routing/RouteSingletonTest.php
  • tests/Integration/Routing/RouteViewTest.php
  • tests/Integration/Support/DeferredCallbackTest.php
  • tests/Mail/Fixtures/GreetingMailable.php
  • tests/Notifications/Fixtures/DeleteWhenMissingNotification.php
  • tests/Notifications/Fixtures/SentMessageMailNotification.php
  • tests/Queue/Fixtures/EloquentTransactionWithAfterCommitTestsJob.php
  • tests/Queue/Fixtures/TestSyncJob.php
  • tests/Routing/Fixtures/AbilityBackedEnum.php
  • tests/Routing/Fixtures/ApiResourceTaskController.php
  • tests/Routing/Fixtures/ApiResourceTestController.php
  • tests/Routing/Fixtures/CreatableSingletonTestController.php
  • tests/Routing/Fixtures/Integration/CategoryBackedEnum.php
  • tests/Routing/Fixtures/NestedSingletonTestController.php
  • tests/Routing/Fixtures/SingletonTestController.php
  • tests/Routing/Fixtures/redirect_routes.php
  • tests/Routing/Fixtures/view.blade.php
  • tests/Routing/Fixtures/wildcard_catch_all_routes.php
💤 Files with no reviewable changes (5)
  • tests/Integration/Routing/Fixtures/SingletonTestController.php
  • tests/Integration/Routing/Fixtures/ApiResourceTestController.php
  • tests/Integration/Routing/Fixtures/ApiResourceTaskController.php
  • tests/Integration/Routing/Fixtures/CreatableSingletonTestController.php
  • tests/Integration/Routing/Fixtures/NestedSingletonTestController.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The changes reorganize database, routing, mail, notification, and queue test fixtures for reuse. Integration tests update fixture imports and add type declarations. The deferred-callback tests add coverage for callbacks deferred from within another callback.

Changes

Database integration tests

Layer / File(s) Summary
Shared Eloquent fixtures and test references
tests/Database/Fixtures/Models/*, tests/Database/DatabaseEloquentIntegrationTest.php, tests/Integration/Database/*
Database model fixtures move to shared namespaces, and integration tests update their imports. The Eloquent integration test imports touch-related fixtures after removing their local declarations.
Database test helpers and signatures
tests/Queue/Fixtures/EloquentTransactionWithAfterCommitTestsJob.php, tests/Integration/Database/EloquentTransactionWithAfterCommitTests.php, tests/Integration/Database/Fixtures/NamedScopeUser.php, tests/Integration/Http/Fixtures/ModelInspectorTestModelResource.php, tests/Integration/Database/ModelInspectorTest.php, tests/Integration/Database/EloquentCollectionFreshTest.php
The transaction job and model-inspector resource move to shared fixtures. Named-scope methods gain types. The collection freshness test updates its fixture, callback types, and email values.

Routing integration tests

Layer / File(s) Summary
Shared routing fixtures
tests/Routing/Fixtures/*, tests/Routing/Fixtures/Integration/*, tests/Integration/Routing/Fixtures/*
Routing controller and callback fixtures move to shared locations. Backed enums move to shared namespaces, and the old integration-local controller fixtures are removed.
Routing test references and typing
tests/Integration/Routing/*
Tests use shared fixtures and revised fixture paths. Test methods and route callbacks gain types. One redirect test dataset uses the Hypervel repository value.

Mail, notification, and deferred-callback tests

Layer / File(s) Summary
Shared mail and notification fixtures
tests/Mail/Fixtures/GreetingMailable.php, tests/Notifications/Fixtures/*, tests/Integration/Mail/SentMessageMailTest.php, tests/Integration/Notifications/SendingNotificationsWithLocaleTest.php, tests/Integration/Queue/DeleteNotificationWhenMissingModelTest.php
Mailable and notification classes move from integration test files to shared fixtures. The integration tests import those fixtures.
Deferred callback nesting test
tests/Queue/Fixtures/TestSyncJob.php, tests/Integration/Support/DeferredCallbackTest.php
The test uses a shared queue job and checks the order of nested deferred callbacks.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to d7ae7

The fixture moves and new regression test present no identified merge-blocking issue; merge after normal checks.

🚥 Pre-merge checks | ✅ 3 | ❌ 1 | ❓ 1

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the fixture consolidation and regression test, but it does not follow the required template. It omits the contribution type, explicit problem-and-change section, supporting ev… Complete the required template sections. Select the contribution type, describe the problem and resulting behavior, identify the regression test and its before-and-after results, list each verification command with its result, and complete …
Docstring Coverage ❓ Inconclusive Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 50 files. (21 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the two main changes: consolidating shared test fixtures and adding coverage for nested deferred callbacks.
Full details: Docstring Coverage

Explanation

Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 50 files. (21 skipped: 21 over the file limit.)

Full details: Description check

Explanation

The description explains the fixture consolidation and regression test, but it does not follow the required template. It omits the contribution type, explicit problem-and-change section, supporting evidence with regression results, verification commands and results, and the required submission checklist.

Resolution

Complete the required template sections. Select the contribution type, describe the problem and resulting behavior, identify the regression test and its before-and-after results, list each verification command with its result, and complete the before-submitting checklist.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@binaryfire

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@binaryfire

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 27, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

@binaryfire I have started the AI code review. It will take a few minutes to complete.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Consolidate shared test fixtures and cover nested deferred callbacks

🧪 Tests ✨ Enhancement 🕐 40+ Minutes

Grey Divider

AI Description

• Move reusable test fixtures into shared locations and update their consumers across database,
 routing, mail, notifications, and queues.
• Preserve Hypervel-specific typing, immutable dates, and test isolation during fixture
 consolidation.
• Verify that request termination runs callbacks deferred from inside another deferred callback.
Diagram

graph TD
  DBTests["Database tests"] --> DBFixtures["Model fixtures"]
  RoutingTests["Routing tests"] --> RoutingFixtures["Routing fixtures"]
  OtherTests["Mail queue tests"] --> SharedHelpers["Shared helpers"]
  HttpTest["Deferred test"] --> DeferredDrain["Callback drain"]
Loading
High-Level Assessment

Keep the shared-fixture approach: it aligns namespaces with fixture locations and avoids duplicate test definitions. Retaining fixtures in individual integration files would reduce moves but preserve the coupling this PR removes; the deferred regression appropriately tests existing behavior through an HTTP request.

Files changed (72) +626 / -283

Refactor (41) +466 / -138
DatabaseEloquentIntegrationTest.phpReuse shared models for ignoring-touch assertions +2/-13

Reuse shared models for ignoring-touch assertions

• Imports the shared integration User and Post fixtures under ignoring-touch aliases and removes the local duplicate model classes.

tests/Database/DatabaseEloquentIntegrationTest.php

Attachment.phpPlace attachment model in shared database namespace +1/-1

Place attachment model in shared database namespace

• Changes the fixture namespace to match its shared database-model location.

tests/Database/Fixtures/Models/Attachment.php

Comment.phpPlace comment model in shared database namespace +1/-1

Place comment model in shared database namespace

• Changes the fixture namespace used by polymorphic relationship tests.

tests/Database/Fixtures/Models/Comment.php

Post.phpMove guarded post into shared namespace +1/-1

Move guarded post into shared namespace

• Aligns the guarded model namespace with its shared fixture path.

tests/Database/Fixtures/Models/Guarded/Post.php

UnixTimeStampToCarbon.phpAlign timestamp caster fixture namespace +1/-1

Align timestamp caster fixture namespace

• Moves the caster into the shared integer-timestamp fixture namespace.

tests/Database/Fixtures/Models/IntTimestampCasts/UnixTimeStampToCarbon.php

UserWithIntTimestampsViaAttribute.phpAlign attribute timestamp fixture namespace +1/-1

Align attribute timestamp fixture namespace

• Moves the attribute-based timestamp model into the shared database namespace.

tests/Database/Fixtures/Models/IntTimestampCasts/UserWithIntTimestampsViaAttribute.php

UserWithIntTimestampsViaCasts.phpAlign cast-based timestamp fixture namespace +1/-1

Align cast-based timestamp fixture namespace

• Moves the cast-based integer-timestamp model into the shared database namespace.

tests/Database/Fixtures/Models/IntTimestampCasts/UserWithIntTimestampsViaCasts.php

UserWithIntTimestampsViaMutator.phpAlign mutator timestamp fixture namespace +1/-1

Align mutator timestamp fixture namespace

• Moves the mutator-based timestamp model into the shared namespace while retaining its immutable-date behavior.

tests/Database/Fixtures/Models/IntTimestampCasts/UserWithIntTimestampsViaMutator.php

UserWithUpdatedAtViaMutator.phpAlign updated-at mutator fixture namespace +1/-1

Align updated-at mutator fixture namespace

• Moves the updated-at mutator model into the shared namespace without changing its mutator.

tests/Database/Fixtures/Models/IntTimestampCasts/UserWithUpdatedAtViaMutator.php

Post.phpShare integration post model +1/-1

Share integration post model

• Changes the post model namespace to its shared Models/Integration location.

tests/Database/Fixtures/Models/Integration/Post.php

User.phpShare integration user model +1/-1

Share integration user model

• Changes the user model namespace to its shared Models/Integration location.

tests/Database/Fixtures/Models/Integration/User.php

BaseModel.phpAlign aggregate base model namespace +1/-1

Align aggregate base model namespace

• Places the aggregate-loading base model in the shared database namespace.

tests/Database/Fixtures/Models/LoadAggregate/BaseModel.php

Related1.phpAlign first aggregate relation namespace +1/-1

Align first aggregate relation namespace

• Places the first related aggregate model in the shared database namespace.

tests/Database/Fixtures/Models/LoadAggregate/Related1.php

Related2.phpAlign second aggregate relation namespace +1/-1

Align second aggregate relation namespace

• Places the second related aggregate model in the shared database namespace.

tests/Database/Fixtures/Models/LoadAggregate/Related2.php

User.phpAlign morph-loading user namespace +1/-1

Align morph-loading user namespace

• Moves the eager-loading user fixture into the shared database namespace.

tests/Database/Fixtures/Models/MorphEagerLoading/User.php

Video.phpAlign morph-loading video namespace +1/-1

Align morph-loading video namespace

• Moves the eager-loading video fixture into the shared database namespace.

tests/Database/Fixtures/Models/MorphEagerLoading/Video.php

Post.phpAlign morph target post namespace +1/-1

Align morph target post namespace

• Moves the morph-target post fixture into the shared database namespace.

tests/Database/Fixtures/Models/MorphToTarget/Post.php

Like.phpAlign post-like model namespace +1/-1

Align post-like model namespace

• Moves the like fixture into the shared database namespace.

tests/Database/Fixtures/Models/PostLikes/Like.php

Post.phpAlign liked-post model namespace +1/-1

Align liked-post model namespace

• Moves the post-likes fixture into the shared database namespace.

tests/Database/Fixtures/Models/PostLikes/Post.php

EloquentTransactionWithAfterCommitTests.phpExtract after-commit transaction job +1/-25

Extract after-commit transaction job

• Imports the shared queue job fixture and removes its inline definition; transaction assertions remain in the test.

tests/Integration/Database/EloquentTransactionWithAfterCommitTests.php

NamedScopeUser.phpBase named-scope fixture on shared user +20/-7

Base named-scope fixture on shared user

• Imports the shared user model and adds explicit builder and void types to the scope methods.

tests/Integration/Database/Fixtures/NamedScopeUser.php

ModelInspectorTest.phpExtract model-inspector resource fixture +1/-5

Extract model-inspector resource fixture

• Imports the resource from its HTTP fixture file and removes the inline class.

tests/Integration/Database/ModelInspectorTest.php

ModelInspectorTestModelResource.phpProvide model-inspector resource fixture +11/-0

Provide model-inspector resource fixture

• Adds a standalone JsonResource fixture for model-inspector assertions.

tests/Integration/Http/Fixtures/ModelInspectorTestModelResource.php

SentMessageMailTest.phpUse shared attachment notification fixture +1/-20

Use shared attachment notification fixture

• Imports the extracted notification and removes its inline class while retaining the mail test's local user.

tests/Integration/Mail/SentMessageMailTest.php

SendingNotificationsWithLocaleTest.phpUse shared greeting mailable +1/-12

Use shared greeting mailable

• Imports the extracted mailable fixture and removes its inline definition.

tests/Integration/Notifications/SendingNotificationsWithLocaleTest.php

DeleteNotificationWhenMissingModelTest.phpExtract missing-model notification fixture +2/-32

Extract missing-model notification fixture

• Imports the shared queued notification, removes its inline definition, and uses the explicit DB facade import.

tests/Integration/Queue/DeleteNotificationWhenMissingModelTest.php

GreetingMailable.phpProvide shared greeting mailable fixture +18/-0

Provide shared greeting mailable fixture

• Extracts the greeting-view mailable for notification locale tests.

tests/Mail/Fixtures/GreetingMailable.php

DeleteWhenMissingNotification.phpProvide shared missing-model notification +47/-0

Provide shared missing-model notification

• Extracts the queued notification, preserving its missing-model deletion attribute and sent flag.

tests/Notifications/Fixtures/DeleteWhenMissingNotification.php

SentMessageMailNotification.phpProvide shared attachment notification +32/-0

Provide shared attachment notification

• Extracts the mail notification and adjusts its attachment path to reach the existing integration-test PDF.

tests/Notifications/Fixtures/SentMessageMailNotification.php

EloquentTransactionWithAfterCommitTestsJob.phpProvide shared after-commit transaction job +39/-0

Provide shared after-commit transaction job

• Extracts the queued token-insertion job, retaining its transaction and using CarbonImmutable for the timestamp.

tests/Queue/Fixtures/EloquentTransactionWithAfterCommitTestsJob.php

TestSyncJob.phpProvide shared synchronous queue job +22/-0

Provide shared synchronous queue job

• Extracts the no-op queued job used to test deferred-callback behavior during synchronous dispatch.

tests/Queue/Fixtures/TestSyncJob.php

AbilityBackedEnum.phpAlign ability enum with shared routing namespace +1/-1

Align ability enum with shared routing namespace

• Changes the enum namespace to match its shared routing-fixture location.

tests/Routing/Fixtures/AbilityBackedEnum.php

ApiResourceTaskController.phpProvide shared task API controller +50/-0

Provide shared task API controller

• Relocates the task-resource controller with typed string responses for resource actions.

tests/Routing/Fixtures/ApiResourceTaskController.php

ApiResourceTestController.phpProvide shared API-resource controller +50/-0

Provide shared API-resource controller

• Relocates the resource controller with typed string responses for resource actions.

tests/Routing/Fixtures/ApiResourceTestController.php

CreatableSingletonTestController.phpProvide shared creatable singleton controller +58/-0

Provide shared creatable singleton controller

• Relocates the controller used by creatable singleton routes and types its action responses.

tests/Routing/Fixtures/CreatableSingletonTestController.php

CategoryBackedEnum.phpAlign category enum with shared routing namespace +4/-1

Align category enum with shared routing namespace

• Updates the enum namespace and documents its code-to-category lookup.

tests/Routing/Fixtures/Integration/CategoryBackedEnum.php

NestedSingletonTestController.phpProvide shared nested singleton controller +42/-0

Provide shared nested singleton controller

• Relocates the nested singleton controller and types its route parameter and responses.

tests/Routing/Fixtures/NestedSingletonTestController.php

SingletonTestController.phpProvide shared singleton controller +42/-0

Provide shared singleton controller

• Relocates the singleton controller with typed string responses.

tests/Routing/Fixtures/SingletonTestController.php

redirect_routes.phpType shared redirect-route callbacks +2/-2

Type shared redirect-route callbacks

• Adds string return types to callbacks in the shared redirect-route fixture.

tests/Routing/Fixtures/redirect_routes.php

view.blade.phpShare route-view template +0/-0

Share route-view template

• Places the existing route-view template in the shared routing fixture directory; the view tests now load it there.

tests/Routing/Fixtures/view.blade.php

wildcard_catch_all_routes.phpType shared wildcard-route callbacks +2/-2

Type shared wildcard-route callbacks

• Adds string return types to callbacks in the shared wildcard-route fixture.

tests/Routing/Fixtures/wildcard_catch_all_routes.php

Tests (31) +160 / -145
EloquentCollectionFreshTest.phpUse shared user in collection refresh test +8/-5

Use shared user in collection refresh test

• Imports the shared integration user, adds explicit void types, and uses Hypervel email examples.

tests/Integration/Database/EloquentCollectionFreshTest.php

EloquentDeleteTest.phpUse shared post for delete tests +1/-1

Use shared post for delete tests

• Replaces the integration-local post import with the shared model fixture.

tests/Integration/Database/EloquentDeleteTest.php

EloquentEagerLoadingLimitTest.phpUse shared guarded post for eager-loading limits +1/-1

Use shared guarded post for eager-loading limits

• Points the limit tests at the shared guarded-post fixture.

tests/Integration/Database/EloquentEagerLoadingLimitTest.php

EloquentHasOneIsTest.phpUse shared attachment for has-one assertions +1/-1

Use shared attachment for has-one assertions

• Updates the attachment model import to the shared database fixtures.

tests/Integration/Database/EloquentHasOneIsTest.php

EloquentModelLoadMaxTest.phpUse shared models for maximum aggregates +3/-3

Use shared models for maximum aggregates

• Imports the shared aggregate base and related models.

tests/Integration/Database/EloquentModelLoadMaxTest.php

EloquentModelLoadMinTest.phpUse shared models for minimum aggregates +3/-3

Use shared models for minimum aggregates

• Imports the shared aggregate base and related models.

tests/Integration/Database/EloquentModelLoadMinTest.php

EloquentModelLoadSumTest.phpUse shared models for sum aggregates +3/-3

Use shared models for sum aggregates

• Imports the shared aggregate base and related models.

tests/Integration/Database/EloquentModelLoadSumTest.php

EloquentMorphConstrainTest.phpUse shared comment for morph constraints +1/-1

Use shared comment for morph constraints

• Updates the comment fixture import to the shared database namespace.

tests/Integration/Database/EloquentMorphConstrainTest.php

EloquentMorphCountEagerLoadingTest.phpUse shared morph-count eager-loading models +3/-3

Use shared morph-count eager-loading models

• Imports shared comment, like, and post fixtures.

tests/Integration/Database/EloquentMorphCountEagerLoadingTest.php

EloquentMorphCountLazyEagerLoadingTest.phpUse shared lazy morph-count models +3/-3

Use shared lazy morph-count models

• Imports shared comment, like, and post fixtures.

tests/Integration/Database/EloquentMorphCountLazyEagerLoadingTest.php

EloquentMorphEagerLoadingTest.phpUse shared eager morph-loading models +2/-2

Use shared eager morph-loading models

• Imports shared comment and video fixtures.

tests/Integration/Database/EloquentMorphEagerLoadingTest.php

EloquentMorphLazyEagerLoadingTest.phpUse shared lazy morph-loading models +2/-2

Use shared lazy morph-loading models

• Imports shared comment and user fixtures.

tests/Integration/Database/EloquentMorphLazyEagerLoadingTest.php

EloquentMorphOneIsTest.phpUse shared attachment for morph-one assertions +1/-1

Use shared attachment for morph-one assertions

• Replaces the local attachment import with the shared fixture.

tests/Integration/Database/EloquentMorphOneIsTest.php

EloquentMorphToEagerLoadTest.phpUse shared comment for morph-to eager loading +1/-1

Use shared comment for morph-to eager loading

• Updates the comment import to the shared fixture namespace.

tests/Integration/Database/EloquentMorphToEagerLoadTest.php

EloquentMorphToGlobalScopesTest.phpUse shared comment for morph-to scopes +1/-1

Use shared comment for morph-to scopes

• Updates the comment import to the shared fixture namespace.

tests/Integration/Database/EloquentMorphToGlobalScopesTest.php

EloquentMorphToIsTest.phpUse shared morph-to comparison models +2/-2

Use shared morph-to comparison models

• Imports the shared comment and morph-target post fixtures.

tests/Integration/Database/EloquentMorphToIsTest.php

EloquentMorphToLazyEagerLoadingTest.phpUse shared lazy morph-to models +3/-3

Use shared lazy morph-to models

• Imports shared comment, user, and video fixtures.

tests/Integration/Database/EloquentMorphToLazyEagerLoadingTest.php

EloquentMorphToSelectTest.phpUse shared morph-to selection models +2/-2

Use shared morph-to selection models

• Imports shared comment and morph-target post fixtures.

tests/Integration/Database/EloquentMorphToSelectTest.php

EloquentMorphToTouchesTest.phpUse shared morph target for touch tests +1/-1

Use shared morph target for touch tests

• Updates the morph-target post import to the shared fixture.

tests/Integration/Database/EloquentMorphToTouchesTest.php

EloquentPaginateTest.phpUse shared guarded post for pagination +1/-1

Use shared guarded post for pagination

• Updates the guarded-post import to the shared fixture.

tests/Integration/Database/EloquentPaginateTest.php

EloquentWhereHasTest.phpUse shared comment for relationship queries +1/-1

Use shared comment for relationship queries

• Updates where-has tests to import the shared comment fixture.

tests/Integration/Database/EloquentWhereHasTest.php

EloquentCastTest.phpUse shared MariaDB timestamp fixtures +4/-4

Use shared MariaDB timestamp fixtures

• Updates four integer-timestamp model imports to their shared namespaces.

tests/Integration/Database/MariaDb/EloquentCastTest.php

EloquentCastTest.phpUse shared MySQL timestamp fixtures +4/-4

Use shared MySQL timestamp fixtures

• Updates four integer-timestamp model imports to their shared namespaces.

tests/Integration/Database/MySql/EloquentCastTest.php

ImplicitBackedEnumRouteBindingTest.phpUse shared category enum for route binding +13/-10

Use shared category enum for route binding

• Updates both the test and cached-route source to import the shared enum; adds explicit return types.

tests/Integration/Routing/ImplicitBackedEnumRouteBindingTest.php

RouteApiResourceTest.phpUse shared API-resource controllers +5/-5

Use shared API-resource controllers

• Imports the relocated resource controllers and adds void return types to test methods.

tests/Integration/Routing/RouteApiResourceTest.php

RouteCachingTest.phpLoad cached routes from shared fixtures +4/-4

Load cached routes from shared fixtures

• Points redirect and wildcard route-cache tests at the shared routing fixture directory and adds void test types.

tests/Integration/Routing/RouteCachingTest.php

RouteCanBackedEnumTest.phpUse shared ability enum in route authorization tests +7/-7

Use shared ability enum in route authorization tests

• Imports the relocated enum and adds explicit return types to tests and callbacks.

tests/Integration/Routing/RouteCanBackedEnumTest.php

RouteRedirectTest.phpUse shared controller in redirect tests +18/-14

Use shared controller in redirect tests

• Updates the controller import, types redirect tests and callbacks, and changes an example repository name to Hypervel.

tests/Integration/Routing/RouteRedirectTest.php

RouteSingletonTest.phpUse shared singleton controllers +30/-30

Use shared singleton controllers

• Imports three relocated controllers and adds void return types to singleton routing tests.

tests/Integration/Routing/RouteSingletonTest.php

RouteViewTest.phpLoad route views from shared fixtures +13/-12

Load route views from shared fixtures

• Updates view lookup paths and adds explicit test and response-callback types.

tests/Integration/Routing/RouteViewTest.php

DeferredCallbackTest.phpVerify nested deferred callbacks after an HTTP request +18/-14

Verify nested deferred callbacks after an HTTP request

• Adds a regression asserting that a callback deferred inside another callback runs in order after a request. Replaces the inline synchronous job with a shared fixture.

tests/Integration/Support/DeferredCallbackTest.php

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@greptile-apps

greptile-apps Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Low risk] Reorganizes test fixture files and updates their imports.

The PR appears safe to merge, with a non-blocking autoloadability concern in the extracted notification fixture.

Fix All in Claude CodeFindings

  1. P2 Fixture model cannot autoload ▶

Summary

The PR consolidates test fixtures across database, routing, mail, notification, and queue tests, and adds HTTP coverage for a callback deferred from another deferred callback.

  • The moved queued-notification fixture retains a dependency on a model that cannot be autoloaded independently.

Reviews (1) · Last reviewed commit: "Consolidate shared test fixtures and cov..."

use Hypervel\Notifications\Notification;
use Hypervel\Queue\Attributes\DeleteWhenMissingModels;
use Hypervel\Queue\SerializesModels;
use Hypervel\Tests\Integration\Queue\DeleteNotificationWhenMissingModelTest\DeleteNotificationTestModel;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Fixture model cannot autoload

This shared notification depends on DeleteNotificationTestModel, which is declared inside DeleteNotificationWhenMissingModelTest.php rather than in its own autoloadable file. The current test loads both classes in one process, but a separate queue worker cannot load the model when restoring the notification. Moving the model into its own fixture would let the notification work independently.

Knowledge Base Used: Testing, debugging, and runtime inspection

Fix in Claude Code Fix in Codex

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This notification is used only by DeleteNotificationWhenMissingModelTest. Its runQueueWorkerCommand() calls queue:work through the in-process Artisan test helper, after the model class has been loaded. No separate-process worker or other test consumes this fixture. Keeping the model local matches upstream and our rule for single-test helpers; extracting it would support a hypothetical consumer rather than fix a failing path.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. runQueueWorkerCommand(['--once' => '1']) executes the worker through the in-process Artisan test helper, and DeleteNotificationWhenMissingModelTest.php has already been loaded before the notification is queued and restored. Since this fixture is only consumed by that test, the model is available throughout the path; a separate worker process is not involved.

Keeping the model local is consistent with the upstream arrangement and the repository's single-test helper convention. This finding does not apply, so no change is needed.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 77 files

Confidence score: 4/5

  • tests/Notifications/Fixtures/DeleteWhenMissingNotification.php pins its constructor to DeleteNotificationTestModel, which is defined inline in a test; that coupling may limit reuse of the shared fixture. Consider moving the model into a shared fixture or making it injectable.
  • tests/Integration/Routing/ImplicitBackedEnumRouteBindingTest.php imports a duplicate CategoryBackedEnum, which could drift from the shared enum; consolidate the fixture and its fromCode() helper.
  • tests/Routing/Fixtures/ApiResourceTestController.php and the related fixture methods and assertions use a backtick in place of the apostrophe, so tests can pass while checking the typo; correct the returned strings and assertions.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="tests/Notifications/Fixtures/DeleteWhenMissingNotification.php">

<violation number="1" location="tests/Notifications/Fixtures/DeleteWhenMissingNotification.php:13">
P3: `DeleteWhenMissingNotification` is a shared fixture (the PR's point is reuse), but its constructor pins `DeleteNotificationTestModel`, a class defined inline in `tests/Integration/Queue/DeleteNotificationWhenMissingModelTest.php`. That class is not PSR-4 autoloadable — `Hypervel\Tests\` maps to `tests/`, which resolves to `tests/Integration/Queue/DeleteNotificationWhenMissingModelTest/DeleteNotificationTestModel.php`, a file that does not exist. The current test only works because `queue:work` runs in-process via `$this->artisan()` after the test file has already been loaded; reusing the fixture from another test or from a separate-process worker fails with class-not-found. Follow the existing `tests/Notifications/Fixtures/Models/NotifiableUser.php` pattern and move the model to an autoloadable fixtures path (e.g. `tests/Notifications/Fixtures/Models/DeleteNotificationTestModel.php`) or define the fixture next to the model.</violation>
</file>

<file name="tests/Integration/Routing/ImplicitBackedEnumRouteBindingTest.php">

<violation number="1" location="tests/Integration/Routing/ImplicitBackedEnumRouteBindingTest.php:9">
P3: The import pulls in a second copy of `CategoryBackedEnum` (`Fixtures\Integration\...`) that duplicates the shared `tests/Routing/Fixtures/CategoryBackedEnum.php` enum, differing only by the added `fromCode()` helper. Since this PR is consolidating shared fixtures, move `fromCode()` into the shared base enum and drop the `Integration/` copy so there is a single definition.</violation>
</file>

<file name="tests/Routing/Fixtures/ApiResourceTestController.php">

<violation number="1" location="tests/Routing/Fixtures/ApiResourceTestController.php:16">
P3: These fixture methods return `I\`m index` with a stray backtick instead of an apostrophe (`I'm`). The typo is replicated in `ApiResourceTaskController` and in the `assertSame('I\`m …', …)` assertions added in `tests/Integration/Routing/RouteApiResourceTest.php`, so the suite passes either way, but the rendered response text is grammatically wrong. Fix the backtick in the fixtures and update the matching assertions together.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

use Hypervel\Notifications\Notification;
use Hypervel\Queue\Attributes\DeleteWhenMissingModels;
use Hypervel\Queue\SerializesModels;
use Hypervel\Tests\Integration\Queue\DeleteNotificationWhenMissingModelTest\DeleteNotificationTestModel;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: DeleteWhenMissingNotification is a shared fixture (the PR's point is reuse), but its constructor pins DeleteNotificationTestModel, a class defined inline in tests/Integration/Queue/DeleteNotificationWhenMissingModelTest.php. That class is not PSR-4 autoloadable — Hypervel\Tests\ maps to tests/, which resolves to tests/Integration/Queue/DeleteNotificationWhenMissingModelTest/DeleteNotificationTestModel.php, a file that does not exist. The current test only works because queue:work runs in-process via $this->artisan() after the test file has already been loaded; reusing the fixture from another test or from a separate-process worker fails with class-not-found. Follow the existing tests/Notifications/Fixtures/Models/NotifiableUser.php pattern and move the model to an autoloadable fixtures path (e.g. tests/Notifications/Fixtures/Models/DeleteNotificationTestModel.php) or define the fixture next to the model.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/Notifications/Fixtures/DeleteWhenMissingNotification.php, line 13:

<comment>`DeleteWhenMissingNotification` is a shared fixture (the PR's point is reuse), but its constructor pins `DeleteNotificationTestModel`, a class defined inline in `tests/Integration/Queue/DeleteNotificationWhenMissingModelTest.php`. That class is not PSR-4 autoloadable — `Hypervel\Tests\` maps to `tests/`, which resolves to `tests/Integration/Queue/DeleteNotificationWhenMissingModelTest/DeleteNotificationTestModel.php`, a file that does not exist. The current test only works because `queue:work` runs in-process via `$this->artisan()` after the test file has already been loaded; reusing the fixture from another test or from a separate-process worker fails with class-not-found. Follow the existing `tests/Notifications/Fixtures/Models/NotifiableUser.php` pattern and move the model to an autoloadable fixtures path (e.g. `tests/Notifications/Fixtures/Models/DeleteNotificationTestModel.php`) or define the fixture next to the model.</comment>

<file context>
@@ -0,0 +1,47 @@
+use Hypervel\Notifications\Notification;
+use Hypervel\Queue\Attributes\DeleteWhenMissingModels;
+use Hypervel\Queue\SerializesModels;
+use Hypervel\Tests\Integration\Queue\DeleteNotificationWhenMissingModelTest\DeleteNotificationTestModel;
+
+#[DeleteWhenMissingModels]
</file context>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only consumer is DeleteNotificationWhenMissingModelTest, which runs queue:work in-process through the Artisan test helper. The model is loaded before dispatch and restoration. This matches the upstream fixture arrangement. There is no independent consumer or separate-process worker here that needs model autoloading, so I am keeping the single-test model local.

use Hypervel\Contracts\Foundation\Application as ApplicationContract;
use Hypervel\Support\Facades\Route;
use Hypervel\Tests\Integration\Routing\Fixtures\CategoryBackedEnum;
use Hypervel\Tests\Routing\Fixtures\Integration\CategoryBackedEnum;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The import pulls in a second copy of CategoryBackedEnum (Fixtures\Integration\...) that duplicates the shared tests/Routing/Fixtures/CategoryBackedEnum.php enum, differing only by the added fromCode() helper. Since this PR is consolidating shared fixtures, move fromCode() into the shared base enum and drop the Integration/ copy so there is a single definition.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/Integration/Routing/ImplicitBackedEnumRouteBindingTest.php, line 9:

<comment>The import pulls in a second copy of `CategoryBackedEnum` (`Fixtures\Integration\...`) that duplicates the shared `tests/Routing/Fixtures/CategoryBackedEnum.php` enum, differing only by the added `fromCode()` helper. Since this PR is consolidating shared fixtures, move `fromCode()` into the shared base enum and drop the `Integration/` copy so there is a single definition.</comment>

<file context>
@@ -6,27 +6,30 @@
 use Hypervel\Contracts\Foundation\Application as ApplicationContract;
 use Hypervel\Support\Facades\Route;
-use Hypervel\Tests\Integration\Routing\Fixtures\CategoryBackedEnum;
+use Hypervel\Tests\Routing\Fixtures\Integration\CategoryBackedEnum;
 
 class ImplicitBackedEnumRouteBindingTest extends RoutingTestCase
</file context>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integration fixture includes fromCode() for explicit route binding; the other enum is the plain backed-enum fixture used by the routing unit tests. Both definitions and their separate placement match upstream. Consolidating them further would add a separate refactor without correcting a test failure or coverage gap.

*/
public function index(): string
{
return 'I`m index';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: These fixture methods return I\m index with a stray backtick instead of an apostrophe (I'm). The typo is replicated in ApiResourceTaskControllerand in theassertSame('I`m …', …)assertions added intests/Integration/Routing/RouteApiResourceTest.php`, so the suite passes either way, but the rendered response text is grammatically wrong. Fix the backtick in the fixtures and update the matching assertions together.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/Routing/Fixtures/ApiResourceTestController.php, line 16:

<comment>These fixture methods return `I\`m index` with a stray backtick instead of an apostrophe (`I'm`). The typo is replicated in `ApiResourceTaskController` and in the `assertSame('I\`m …', …)` assertions added in `tests/Integration/Routing/RouteApiResourceTest.php`, so the suite passes either way, but the rendered response text is grammatically wrong. Fix the backtick in the fixtures and update the matching assertions together.</comment>

<file context>
@@ -0,0 +1,50 @@
+     */
+    public function index(): string
+    {
+        return 'I`m index';
+    }
+
</file context>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are arbitrary marker strings in test-only controllers, matched by the routing assertions. They are unchanged from upstream and are not application response text. Rewriting the strings and assertions together would not improve what the tests verify, so I am keeping them aligned with upstream.

@binaryfire
binaryfire merged commit cbf55f6 into 0.4 Sep 28, 2026
48 checks passed
@binaryfire
binaryfire deleted the upstream-sync-framework-03 branch October 10, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant