Adopt Double across core framework tests

Merged
BI
2d ago
+13056-14382

Test doubles and real behavior

Adopt Double across core framework tests, following Laravel's 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 Source parameter 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(): array on 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.

[!NOTE]

Adopt JMac Double across core framework tests and remove Mockery

  • Replaces Mockery mocks with JMac testing doubles and the PHPUnit VerifiesDoubles trait across queue, cache, database, mail, auth, events, view, and support tests; adds jasonmccreary/double ^1.1.1 to composer.json.
  • Rewrites Eloquent relation tests (createOrFirst, firstOrCreate, updateOrCreate, belongsToMany, hasManyThrough) to run against in-memory SQLite with separate read/write databases instead of mocked connections, adding coverage for replica reads and cross-parent isolation.
  • Replaces mocked AWS clients with the SDK's MockHandler in SQS and SES v2 tests, and swaps mocked clocks for CarbonImmutable's test clock.
  • Fixes SesV2Transport::doSend to stop sending the v1-only Source parameter in SES v2 requests.
  • Behavioral Change: removes a number of existing test cases (e.g. HasOne default-value tests, model destroy/update-process tests, database queue payload checks, AuthenticateSession unit cases — some re-homed as integration tests); several assertion values change (e.g. pluck key now null, read_at now CarbonImmutable, upsert timestamp key order).

Macroscope summarized 5568bb0.