Repository navigation
Adopt Double across core framework tests - #110
Conversation
Audit real consumers and implementation semantics for behavior every conforming implementation must expose. Treat Hypervel contracts as greenfield interfaces rather than inheriting missing declarations from Laravel. Keep internal helpers and implementation-specific capabilities off general contracts, and update implementations, tests and public-contract documentation together during the audit.
Use Double for new test doubles and convert direct Mockery mocks and spies when porting from any upstream. Preserve upstream PHPUnit doubles and Mockery-backed framework helpers, with framework-owned cleanup and explicit Double verification. Explain lenient argument matching, overlapping allowed calls that bypass maximum counts, native fluent self-returns and static-return requirements. Retain concrete model fixtures for distinct instances and remove redundant guidance. Align the porting policy and checklists through links to the shared convention. Convert the Hypervel container and error-handler examples in the Hyperf guide, including the container control-name collision, while preserving the Hyperf source examples.
Add jasonmccreary/double ^1.1.1 as a development dependency for native test doubles and per-test verification. Retain Mockery for the framework testing APIs that expose its expectations and spies. This prepares the test conversion from Laravel framework PR #61947 at c980cb5827c6512c12ac44493d172a593b41299a. Dependencies are installed independently in the worktree; the root lock file remains untracked.
SES v2 ignores Source, and the envelope sender can describe the return path rather than the FromEmailAddress identity. Remove the unsupported parameter while preserving raw sender headers, explicit SES options and recipient handling. Replace transport mocks with the real SDK MockHandler and verify serialized HTTP payloads, message identifiers, tenant options and error behavior. Reconcile the transport test conversion from Laravel framework PR #61947 without mapping a bounce address to the sending identity. Validation: MailSesV2TransportTest, all three static-analysis configurations and repository formatting pass.
Only omitted or empty queue options mean no queue filter. Preserve the valid queue name 0, and filter only empty strings from retry job and batch identifiers so nonempty zero identifiers reach repository lookup and not-found diagnostics. Extend the existing regression datasets and convert the affected tests to native Double expectations and real SDK request handling. Preserve exact payloads, failure events and retry range behavior while reconciling Laravel framework PR #61947. Validation: both retry command test classes, all three static-analysis configurations and repository formatting pass.
Response assertions consume gatherData through the View contract to inspect effective rendering data, including shared values. Declare gatherData(): array on that contract instead of relying on an undeclared concrete capability. The standard View already implements it. Adapt the handwritten Markdown view fixture, document the requirement for custom implementations, and retain a source explanation of the deliberate Laravel contract difference. Convert TestResponse collaborators to native Double contracts while preserving streaming, JSON, session and model-identity coverage. Validation: TestResponseTest and MarkdownCoroutineSafetyTest pass, as do all three static-analysis configurations and repository formatting.
Reconcile Laravel framework PR #61947 against c980cb5827c6512c12ac44493d172a593b41299a. Use native Double collaborators with per-test verification, preserving meaningful argument, identity, ordering, required-call and forbidden-call assertions. Replace query and session plumbing mocks with real SQLite rows, HTTP requests and session state. Move Redis behavior into service integration coverage and exercise actual SDK command serialization. Remove obsolete database mock suites only after retaining their distinct coverage in integration tests. Preserve Hypervel coroutine ownership, cancellation, pooling, immutable dates, atomic publication, typed validation and cache behavior. Keep real fixtures for native static return types, explicit container collision handling, established unsupported-driver exclusions and framework-owned state cleanup. Mockery-backed framework testing APIs and their dedicated tests remain supported. Validation: every changed test class was run individually, including isolated Redis integration coverage. All three static-analysis configurations and repository formatting pass. The Redis SCAN_PREFIX regression runs in the existing Cluster CI job without a topology skip.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
PR Summary by QodoAdopt Double across framework tests and expand integration coverage
AI Description
Diagram
High-Level Assessment
Files changed (225)
|
Code Review by Qodo
1. Queue tests contaminate later payloads
|
[Medium impact] The PR appears safe to merge, with both previous findings addressed and no new actionable issues found. SummaryAdopts
Both previous findings are addressed. No new actionable issues were found in the changes since the previous review. This review used source inspection; tests were not run. Reviews (2) · Last reviewed commit: "test: retain behavioral coverage after D..." · Reviewed by Greptile |
Exercise translation registration both before and after translator resolution, and verify that changing a password during an authenticated request refreshes the stored session hash. Validate serialized SQS command names and restored job types, with a concrete message-group state assertion. Require the nullable route lookups so lenient defaults cannot hide a wrong parameter, and inspect unmatched relationship state without lazy-loading it. Make the existing attach-touch test distinguish creation and attachment timestamps. Clarify that backdated Redis membership scores isolate expiry pruning from orphan cleanup rather than adding duplicate scan instrumentation. Validation: all seven changed test classes pass, including isolated Redis integration coverage. Formatting and whitespace checks pass; production code is unchanged.
|
The five Qodo findings have been checked:
|
Test doubles and real behavior
Adopt Double across core framework tests, following the upstream test conversion. Mockery-backed framework helpers and their integration tests remain supported, as do existing upstream PHPUnit doubles.
Related fixes
Sourceparameter from the SES v2 transport, preserving raw sender headers and explicit SES options."0"and nonempty zero identifiers in retry commands.gatherData(): arrayon the View contract because response assertions consume effective rendering data, including shared values. Custom View implementations must provide it; the standard View already does. Document this contract difference and track a broader contract-completeness audit.Validation
Changed test classes and isolated Redis integration tests pass locally. Static analysis and formatting pass. The existing Redis Cluster CI job also covers the prefix regression without a Cluster skip.
Summary by cubic
Adopts Double for test doubles across core framework tests, following the upstream test conversion. Direct Mockery mocks and spies are replaced with native Double collaborators and per-test verification, while Mockery-backed framework helpers and upstream PHPUnit doubles remain supported.
Related fixes
Sourceparameter from the SES v2 transport."0"and nonempty zero identifiers in retry commands.gatherData(): arrayon the View contract because response assertions consume effective rendering data, including shared values.Migration
gatherData(): array; the standard View already does.Written for commit 5568bb0. Summary will update on new commits.
Note
Adopt JMac Double test doubles across core framework tests
jasonmccreary/double(added in composer.json), usingDouble::for,Argumentmatchers, and the PHPUnitVerifiesDoublestrait across auth, bus, cache, database, queue, view, and broadcasting tests.createOrFirst/firstOrCreate/updateOrCreaterelation tests, concrete containers, real Request objects, Carbon test clocks, and AWS SDK MockHandlers for SES and SQS tests.gatherData(): arraymethod to theViewcontract in View.php and documents it in README.md and porting-from-laravel.md."0"are no longer dropped by falsey filtering. Also removes the v1-onlySourcefield from SES v2 requests in SesV2Transport.php.Viewcontract implementers must addgatherData(); many legacy tests were deleted rather than migrated, so coverage for some Redis, model, and queue scenarios (e.g.DatabaseEloquentModelTestincrement/destroy cases) is reduced;SesV2Transportrequests no longer includeSource.Macroscope summarized 5568bb0.