Adopt Double across core framework tests
Merged
BI
2d ago+13056+13056+01234567890123456789012345678901234567890123456789-14382-14382-01234567890123456789012345678901234567890123456789
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.
- Replace direct Mockery mocks and spies with native Double collaborators and per-test verification.
- Exercise real database rows, HTTP requests, sessions and SDK requests where the old tests mocked implementation details.
- Move Redis behavior into service integration tests and consolidate replaced database coverage without losing distinct assertions.
- Preserve Hypervel's coroutine isolation, cancellation, connection ownership, atomic writes and typed validation coverage.
- Update testing and porting guidance so new tests use Double and future ports convert direct Mockery usage consistently.
Related fixes
- Remove the ignored SES v1
Sourceparameter from the SES v2 transport, preserving raw sender headers and explicit SES options. - Preserve queue name
"0"and nonempty zero identifiers in retry commands. - Declare
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.
- Replace implementation mocks with real database rows, HTTP requests, sessions, and SDK requests.
- Move Redis behavior into service integration tests and consolidate replaced database coverage without losing distinct assertions.
- Preserve Hypervel coroutine isolation, cancellation, connection ownership, atomic writes, and typed validation coverage.
- Update testing and porting guidance so new tests use Double and future ports convert direct Mockery usage consistently.
- Retain behavioral coverage for translation registration before and after resolver, password-change session hashes, serialized SQS commands, nullable route lookups, unmatched relationship state, and attach-touch timestamps.
Related fixes
- Remove the ignored SES v1
Sourceparameter from the SES v2 transport. - Preserve queue name
"0"and nonempty zero identifiers in retry commands. - Declare
gatherData(): arrayon the View contract because response assertions consume effective rendering data, including shared values.
Migration
- Custom View implementations must provide
gatherData(): array; the standard View already does.
[!NOTE]
Adopt JMac Double test doubles across core framework tests
- Migrates the framework test suites from Mockery to
jasonmccreary/double (added in composer.json), using Double::for, Argument matchers, and the PHPUnit VerifiesDoubles trait across auth, bus, cache, database, queue, view, and broadcasting tests.
- Replaces many mocked-collaborator setups with real implementations: in-memory SQLite fixtures for Eloquent
createOrFirst/firstOrCreate/updateOrCreate relation tests, concrete containers, real Request objects, Carbon test clocks, and AWS SDK MockHandlers for SES and SQS tests.
- Adds the
gatherData(): array method to the View contract in View.php and documents it in README.md and porting-from-laravel.md.
- Fixes queue retry commands in RetryCommand.php and RetryBatchCommand.php so the string IDs and queue name
"0" are no longer dropped by falsey filtering. Also removes the v1-only Source field from SES v2 requests in SesV2Transport.php.
- Behavioral Change:
View contract implementers must add gatherData(); many legacy tests were deleted rather than migrated, so coverage for some Redis, model, and queue scenarios (e.g. DatabaseEloquentModelTest increment/destroy cases) is reduced; SesV2Transport requests no longer include Source.
Macroscope summarized 5568bb0.