Skip to content

Complete the framework test conversion to Double - #749

Merged
binaryfire merged 75 commits into
0.4from
tests-double-after-foundation
Nov 17, 2026
Merged

binaryfire merged 75 commits into
0.4from
tests-double-after-foundation

Conversation

@binaryfire

@binaryfire binaryfire commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Complete the Double conversion

Convert the remaining directly created Mockery mocks and spies to Double across the framework tests and pooled-connection benchmark fixtures. Keep Mockery where it backs framework testing APIs, including facade expectations, container mocking helpers, console expectations and authentication helpers.

Use real objects where mocking adds no value, preserve initialized behavior for partial doubles, and make meaningful call counts, negative expectations and ordering explicit. Redis tests use real forwarding and native-client fixtures, including the existing scan fixtures that preserve cursor updates. Remove redundant tests while retaining their distinct coverage.

Framework corrections

  • Preserve falsey and named authorization arguments in the Can validation rule and allow gates to receive ordinary data. Cache policy discovery for declared model names and preserve their configured policy resolution. Normalize guesses from other inputs so arbitrary spellings cannot grow worker memory. Explicit policy mappings remain available for unusual PHP aliases requiring their own container configuration.
  • Add a production Doctor check for authoritative Composer class maps, with matching deployment guidance. Preserve the current loader mode when repairing autoload validity.
  • Declare the cache repository's shared public operations on its contract. Make ordinary flush() emit the same lifecycle events as clear(), including failure events, and preserve cancellation handling.
  • Inline the single-use Redis transaction trait into RedisProxy, add native return types, and correct RedisConnection::client() to include null after close. Remove the analyzer special case made unnecessary by the move.
  • Require PhpRedis 6.3 for components development so tests can reflect native methods. Published package requirements remain unchanged; record the separate framework-wide minimum-version proposal for later work.

Validation

Run the affected test files throughout the conversion, including real Redis and database integration cases. Verify the cache flush regression, failure and cancellation paths, authorization consumers, analyzer behavior and generated facade annotations. Full static analysis and formatting pass. Smoke-test the changed benchmark fixtures without changing benchmark measurements.

Note

Complete the framework test conversion to Double

  • Migrates nearly all framework tests from Mockery to JMac testing doubles with the PHPUnit VerifiesDoubles trait. Strict doubles, allows/expects/returns/throws APIs, and Argument matchers replace Mockery expectations across JWT, Redis, queue, OpenTelemetry, Sentry, Socialite, validation, routing, and Testbench tests.
  • Adds a new ComposerAutoloadIsAuthoritative doctor diagnostic and registers it in DoctorServiceProvider. ComposerAutoloadIsValid now selects --classmap-authoritative or --optimize for its remediation command based on the current autoloader mode.
  • Changes Can::passes to pass all configured arguments positionally (including falsey values) to the gate callback, followed by the validated value.
  • Narrows Gate policy caching: only exact declared class names are cached, and getPolicyFor treats non-object/non-string first arguments as non-policy candidates.
  • Adds RedisProxy::pipeline/transaction methods with a new executeMultiExec helper, a Cache Repository::flush method, and typed cache accessors (string, integer, float, boolean, array, many, missing, putMany) to the cache contract.
  • Raises ext-redis requirement from ^6.1 to ^6.3 in composer.json.
  • Behavioral Change: Can::passes no longer drops falsey arguments or shifts the first argument; gate callbacks receive a different argument order. Repository.php cache contract gains many new required methods for implementations. RedisConnection::client return type is narrowed to Redis|RedisCluster|null.

Macroscope summarized 6ddba98.

Native Redis and RedisCluster doubles exercise hash-expiry methods declared by PhpRedis 6.3. Align the components development requirement with those tests and the existing CI image, without changing any published package requirement or runtime compatibility checks.

Composer resolution and manifest validation pass. The Redis doctor and AnyTag put-many tests pass with the declared development dependency.
Record the complete metadata, diagnostics, compatibility cleanup, tests and documentation needed for a future runtime minimum bump. Preserve optional Redis installation, explain the Composer conflict tradeoff, and distinguish obsolete client gates from necessary server, build and topology checks.

Self-reviewed against the current call sites and package metadata. The plan is deferred and requires authorization before implementation; only the development minimum has changed.
Move the single-consumer MultiExec methods onto RedisProxy beside the scan methods and delete the trait. Preserve the transaction and pipeline implementations while declaring their native return unions. Remove the analyzer's obsolete trait-declaring-class exception.

Include null in RedisConnection::client() after close or failed connection setup. Keep the shared native-client test access separate from production getConnection()/client() semantics and update its existing consumers.

Validated Redis proxy and multi-exec coverage, affected Redis connection/cache tests, cancellation analyzer tests, facade regeneration and facade docblocks. Full source/type/skeleton analysis and formatting pass.
Replace direct Mockery doubles with typed Double expectations across client connections, routing, server calls, exception mapping and response creation. Retain call counts, argument constraints, cancellation expectations and response assertions, using strict doubles where unexpected calls must fail.

Each changed test file passes. Source analysis and formatting pass.
Use a real container and configuration repository for hashing setup, with Double reserved for the custom driver. Exercise the Hasher contract's real make() API when checking facade forwarding instead of an invented mock method.

Convert the head schema logger expectation while retaining warning context and call-count checks. All changed test files pass; formatting and source analysis pass.
Replace direct Mockery test doubles with Double while retaining framework-provided mock APIs. Share real Redis proxy, pool and connection forwarding around strict native clients, and preserve production client()/getConnection() behavior.

Exercise the real withConnection lease path for locks and metrics, use configuration-driven cluster selection, and freeze time for exact native eval arguments. Keep process destructor allowances separate from explicit operation expectations, and retain lifecycle, payload and listener assertions.

Every changed unit and integration test file passes, including the Redis-backed Horizon integration tests. Source/type/skeleton analysis and formatting pass.
Replace direct Mockery test doubles with typed Double expectations for HTTP clients, request helpers, streaming responses and Swoole bridges. Preserve argument constraints and negative expectations; execute response-stat callbacks through resolvers rather than matcher side effects.

Make the Swoole response helper allow only explicitly requested incidental successful methods. Keep those defaults disjoint from required header and emission expectations, including the sendfile headers.

Each changed test file passes, with the existing Swoole-dependent skip retained. Source analysis and formatting pass.
Replace direct Mockery doubles with Double while retaining framework-backed mocking APIs and real child-process fixtures. Keep image pipeline argument checks and cache behavior assertions.

Use a fulfilled promise for resolved response data, and remove the unused BladeCompiler/filesystem setup from the directive test so it exercises the configured application compiler directly.

All changed test files pass; the existing image environment skip remains. Source analysis and formatting pass.
Replace direct Mockery doubles throughout JWT parsing, guards, events, manager setup and cache storage. Preserve the cancellation, context, payload and subject-lock assertions and all required calls.

Use an override control wrapper for the container's reserved instance method, establish default leeway before test-specific configuration, and use concrete tagged-cache return types for the optional tags capability.

Every changed JWT test file passes. Full source/type/skeleton analysis and formatting pass.
Use Double for loggers, event dispatchers, queue jobs and the native server in the logging test suite. Preserve context isolation, queue propagation and logging argument assertions.

Remove unused dispatcher defaults and execute intentional event side effects through resolvers, keeping the required dispatch expectations explicit.

All changed logging test files pass. Full source/type/skeleton analysis and formatting pass.
Replace direct Mockery doubles in attachment, transport, rendering and queued-mail tests. Preserve required calls and forbidden MIME detection, and keep real QueueFake behavior for queue-routing assertions.

Use a real view factory and engine resolver beneath the Markdown rendering doubles so render-local clones retain their initialized finder state. All nine changed test files passed individually.

Validation for the complete conversion slice: composer lint:fix, composer analyse and git diff --check passed.
Keep registrar and command expectations strict, and use real OutputStyle behavior around the mocked question response. Preserve process cancellation and cleanup ordering, with a separate allowance for the destructor's one-argument stop call.

All four changed test files passed individually, including the real subprocess transport cases.

Validation for the complete conversion slice: composer lint:fix, composer analyse and git diff --check passed.
Replace resolver, connection, grammar and query-builder mocks with doubles of their native types. Preserve optional metadata stubs and the assertion that structural identity does not open a database connection.

NestedSetTest passed all 20 tests and 46 assertions.

Validation for the complete conversion slice: composer lint:fix, composer analyse and git diff --check passed.
Replace direct dispatcher, mail factory and Markdown mocks while retaining the real notification rendering and coroutine-isolation behavior. Existing framework-backed test helpers remain unchanged.

Both changed test files passed individually.

Validation for the complete conversion slice: composer lint:fix, composer analyse and git diff --check passed.
Preserve strict lifecycle, reporting, cancellation and cleanup expectations. Express conditional required or forbidden reporting with exact counts, and inject the native instances from application override controls.

Keep real pools and lifecycle fixtures for stateful behavior. All seven changed test files passed individually.

Validation for the complete conversion slice: composer lint:fix, composer analyse and git diff --check passed.
Replace direct Mockery dependencies throughout deferred signals, instrumentation, providers, logging and export scheduling. Preserve required calls, forbidden work, callback registration and concurrent lifecycle checks.

Keep the manager container strict while checking identity registration through recorded calls. Consolidate repeated identical export expectations into one counted callback, and remove an unused cache-test parameter and artificial assertion counts.

Every changed test file passed individually; the corrected manager tests pass 15 tests and 94 assertions.

Validation for the complete conversion slice: composer lint:fix, composer analyse and git diff --check passed.
Use strict doubles for console kernel and runtime inputs, and application override controls for configuration source discovery. Preserve optional provider-discovery stubs and the real analyzer fixtures.

Both changed files passed with phpunit.phpstan.xml.dist: 16 tests and 41 assertions combined.

Validation for the complete conversion slice: composer lint:fix, composer analyse and git diff --check passed.
Replace the remaining direct view-factory mocks while keeping real resolver rebinding and coroutine-local pagination checks. No pagination source or public API changes.

PaginationResolverTest passed 18 tests and 42 assertions.

Validation for the complete conversion slice: composer lint:fix, composer analyse and git diff --check passed.
Preserve native WebAuthn types, real action behavior around protected validation doubles, and controller failure responses. Keep event spies intentionally lenient while asserting exact listener checks and forbidden dispatches after execution, without overlapping default stubs.

All seven changed test files passed individually; real ceremony fixtures and existing PHPUnit doubles remain.

Validation for the complete conversion slice: composer lint:fix, composer analyse and git diff --check passed.
Replace the remaining direct mocks across client authentication, replay protection, token issuance, guards, signing keys and response rendering. Preserve memoization counts, negative lookups, token invalidation failures and callback-driven concurrency checks.

Use real Eloquent forwarding over a native query-builder double. Keep cache coordinator passthru behavior with disjoint failing-key stubs and real invalidation delegates. Consolidate identical key-generation and resource-validation expectations into counted sequences.

Every changed test file passed individually, including all three PostgreSQL signing-key concurrency tests on an isolated database.

Validation for the complete conversion slice: composer lint:fix, composer analyse and git diff --check passed.
Document why the Stdio transport test permits stop(0.0): Symfony calls it when the process double is released. This preserves the existing destructor cleanup without obscuring explicit stop expectations.

Validation: StdioTransportTest passed (14 tests, 43 assertions).
Replace directly created Mockery doubles with native Double targets and automatic verification. Preserve the cache lookup, callback and stored-value assertions.

Every changed test file was run during conversion; fixture changes were verified through their consumers. Full formatting and static analysis passed at the slice checkpoint.
Convert direct doubles for permission events, guards, cache integration and partition queue context. Keep Mockery-backed facade APIs intact and separate default event-listener stubs from constrained expectations.

Every changed test file was run during conversion; fixture changes were verified through their consumers. Full formatting and static analysis passed at the slice checkpoint.
Use Double for directly created pipeline dependencies while retaining the existing execution, exception and container behavior coverage. Required calls remain expectations and optional setup remains explicit stubbing.

Every changed test file was run during conversion; fixture changes were verified through their consumers. Full formatting and static analysis passed at the slice checkpoint.
Use initialized native process doubles and preserve stop arguments, call counts, output guards and cancellation cleanup. A local destructor-free process fixture keeps implicit Symfony destructor cleanup from consuming expectations for explicit stop calls; these fixtures never start child processes.

Validation: ProcessTest passed (124 tests, 343 assertions, one existing skip); formatting and analysis passed.
Replace the direct Mockery animation dependency with a verified Double target. Keep the existing isolated process and coroutine execution behavior.

Validation: PromptAnimationTest passed; formatting and analysis passed.
Preserve transaction callbacks, publication outcomes, retries, cancellation and cleanup with typed Double expectations. Replace SQS magic-method mocks with a real SDK client using its in-memory MockHandler, and exercise Redis publication through native connection forwarding.

Retain explicit post-call checks where configurable cache defaults must coexist with call-count assertions. Use native Pheanstalk interfaces and real initialized queue fixtures instead of phantom methods.

Every changed test file was run during conversion; fixture changes were verified through their consumers. Full formatting and static analysis passed at the slice checkpoint.
Preserve queue identifiers, typed worker options, retry payloads and failed-record handling with strict native doubles. Capture retry payloads directly and exercise SQS retry commands through the real SDK with an isolated handler, checking FIFO metadata and consumed responses.

Every changed test file was run during conversion; fixture changes were verified through their consumers. Full formatting and static analysis passed at the slice checkpoint.
Convert remaining queue dispatch, pooling, driver, job and middleware doubles in this slice. Preserve required calls, forbidden calls and callback ordering; use queued-command fixtures with InteractsWithQueue for middleware and native queue jobs for worker paths.

Exercise CallQueuedHandler failure injection directly instead of a placeholder assertion. Reuse NullQueue behavior in the pool fixture, retain real Pheanstalk job data, and use the SQS SDK handler for lifecycle failures and response consumption.

Every changed test file was run during conversion; fixture changes were verified through their consumers. Full formatting and static analysis passed at the slice checkpoint. WorkerTimeoutTest passed all 11 cases using the converted subprocess fixture.
Convert directly created doubles in queue middleware, reservation, resource-lifetime and outbox claim coverage. Retain framework-backed Mockery spies and preserve real SQLite/Redis behavior and cancellation assertions.

Use command fixtures for middleware and an explicit publishing queue fixture for pooled outbox lifetime checks. No service discovery or production behavior changes.

Every changed test file was run during conversion; fixture changes were verified through their consumers. Full formatting and static analysis passed at the slice checkpoint. SQLite and isolated Redis consumers passed; existing engine-specific skips remain unchanged.
Convert database constraint and rendered-view dependencies to strict doubles without changing their behavioral assertions. Replace only the Telescope dependency doubles in the global cleanup tests; retain Mockery-specific verification and cleanup coverage.

Validation: all three changed test files passed. Full static analysis and formatting passed.
Preserve application casting failure isolation, view exception forwarding, request-scoped shared data, and static cleanup coverage. Use the real engine resolver and strict doubles for collaborators, with proxy override mode for the application's instance method collision.

Validation: every changed test file passed. Full static analysis and formatting passed.
Retain batch query counts, fallback memoization, typed identity matching, compiled execution, and field substitution assertions with strict doubles. Replace assertion side effects in a matcher with a pure predicate, and use real container and translator objects for factory state tests.

Validation: all four files passed, including 214 compiled-execution tests with 806 assertions. Full static analysis and formatting passed.
Pass falsey field values and additional arguments through the Can rule unchanged. Restrict policy dispatch to strings and objects so ordinary gate callbacks accept numeric, boolean, and array context without type errors.

Cache policy discovery only for real classes after resolution, retaining cached negative results and enum classes while preventing request-derived strings from growing worker memory. Preserve explicit mappings and custom guessers. Restore upstream's repeated non-class guesser test and use real classes for cache assertions.

Validation: AuthAccessGateTest passed (148 tests, 309 assertions); ValidationRuleCanTest passed (8 tests, 37 assertions). Regression cases were confirmed against the old behavior. Full static analysis and formatting passed.
Add a default Doctor diagnostic that fails production checks when Composer's class map is not authoritative, with the release-build command and worker restart remediation. Skip the check in local mode; leave loader state and development behavior unchanged.

Document the production deployment check, porting requirement, and generated-proxy loader compatibility. Authoritative maps avoid filesystem misses and Composer's worker-lifetime cache of missing names without framework-owned loader workarounds.

Validation: the real Doctor command passes its local, failing-production, and passing-production cases (3 tests, 10 assertions). Provider registration tests passed (48 tests, 210 assertions). Full static analysis, formatting, and whitespace checks passed.
Move the contract completeness guidance into Code conventions using the approved wording. Require documented behavior shared by all implementations to be declared on the contract, including omissions inherited from Laravel, while keeping optional capabilities on separate interfaces.

Remove the narrower PHPStan-only copy and renumber that checklist. Preserve the existing approval requirement for Laravel API changes.
Replace direct Mockery doubles with Double while retaining strict calls and meaningful negative expectations. Use a real container for lookup-only setup and record cross-object shutdown order explicitly.

Validation: all affected Watcher and Wayfinder test classes passed; full static analysis and formatting passed.
Keep handshake, message and close failure coverage with typed doubles and explicit lifecycle expectations. Use real container wiring for bootstrap and preserve caller-owned dispatcher expectations in helpers.

Validation: every affected WebSocket test class passed, including cancellation and cleanup cases; full static analysis and formatting passed.
Replace direct Mockery dependencies while preserving PostgreSQL conversation concurrency and auth cache invalidation coverage. Match cache repositories by identity and check that invalidation has not occurred before transaction commit.

Validation: PostgreSQL conversation storage/concurrency cases and the auth cache suite passed; full static analysis and formatting passed.
Extract the existing typed Redis proxy fixture for unit and integration consumers. Use initialized Double partials for queue fakes and broadcast managers, and real requests, routers and cache repositories where their behavior matters.

Validation: Redis broadcaster, broadcast manager and anonymous broadcast tests passed; full static analysis and formatting passed.
Declare shared typed getters, bulk operations, missing and flush on the repository contract so interface consumers can call the public cache API. Keep optional capabilities separate.

Route native flush through clear so ordinary flushes emit success/failure events and preserve cancellation handling. Update memoized flush coverage, remove an obsolete analyzer suppression and regenerate the Cache facade. Convert the remaining cache integration doubles using the completed contract.

Validation: regression cases failed before the event fix and passed afterward. The Cache suite, memoized integration cases and seven Redis integration files passed; full analysis, formatting and facade checks passed.
Use Double for direct console integration dependencies, keeping initialized queue fakes and explicit connection selection. Preserve environment encryption/decryption and scheduling behavior assertions.

Validation: every affected console and concurrency test file passed; full static analysis and formatting passed.
Replace Mockery in Eloquent query-count and pooled connection tests. Preserve initialized database pool behavior, protected connection creation stubs and shared SQLite PDO lifecycle assertions.

Validation: affected Eloquent, pooled connection, SQLite heartbeat and shared-PDO tests passed; full static analysis and formatting passed.
Use initialized filesystem partials for installer failure cases, with targeted throwing stubs and exact exception assertions. Retain real filesystem behavior for other paths without fallback doubles. Convert command and authentication dependencies while preserving cleanup and framework-backed mocking APIs.

Validation: each changed foundation test class passed, including installer read/publication failures; full static analysis and formatting passed.
Convert filesystem, generator, routing, session, support and view dependencies. Keep framework facade expectations where required and use a passthru compiler with a received-call assertion to verify view-path deduplication while compiling real templates.

Validation: all affected files passed, including SQLite sessions and task-owned Redis sessions; full static analysis and formatting passed.
Replace benchmark-only Mockery clients with typed Pusher and Ably doubles and a real Mercure token provider. Keep the existing controlled delivery delay and pool behavior without depending on Mockery cleanup.

Validation: syntax and command help passed; one operation each for Pusher, Ably and Mercure completed locally without external HTTP calls. No benchmark measurements were changed.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Deploying hypervel-org with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6ddba98
Status:🚫  Build failed.

View logs

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

Copy link
Copy Markdown

PR Summary by Qodo

Complete framework test migration to Double and tighten runtime contracts

🧪 Tests 🐞 Bug fix ✨ Enhancement 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Convert remaining direct Mockery test doubles to Double while preserving framework testing APIs
 and integration behavior.
• Fix authorization arguments, cache flush events, Redis types, and production autoloader
 diagnostics.
• Require PhpRedis 6.3 for development; document deployment guidance and defer the runtime-minimum
 proposal.
Diagram

graph TD
  T["Framework tests"] --> D["Double fixtures"] --> F["Framework components"]
  F --> A["Authorization"]
  F --> C["Cache repository"]
  F --> R["Redis proxy"]
  F --> H["Doctor checks"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Migrate tests without production corrections
  • ➕ Smaller behavioral review surface
  • ➕ Easier to isolate test-only regressions
  • ➖ Leaves discovered cache, authorization, and Redis defects unresolved
  • ➖ New tests would need to accommodate incorrect behavior
2. Replace all Mockery usage indiscriminately
  • ➕ One mocking convention everywhere
  • ➖ Would disrupt facade expectations and framework-provided testing APIs
  • ➖ Requires unnecessary rewrites of supported public helpers

Recommendation: Keep the selective Double migration: preserve Mockery-backed framework APIs and use real objects or forwarding fixtures where behavior matters. Review the production corrections as distinct regression areas; the separate PhpRedis runtime-minimum proposal is appropriately deferred.

Files changed (519) +15112 / -14157

Enhancement (3) +126 / -0
Repository.phpDeclare shared cache operations +74/-0

Declare shared cache operations

• Adds typed retrieval, many, missing, putMany, and flush methods to the public repository contract.

src/contracts/src/Cache/Repository.php

ComposerAutoloadIsAuthoritative.phpCheck production Composer class maps +50/-0

Check production Composer class maps

• Passes when production autoloading is authoritative, fails with remediation otherwise, and skips the requirement locally.

src/doctor/src/Diagnostics/ComposerAutoloadIsAuthoritative.php

DoctorServiceProvider.phpRegister Composer autoload diagnostic +2/-0

Register Composer autoload diagnostic

• Adds the new diagnostic to Doctor's registered checks.

src/doctor/src/DoctorServiceProvider.php

Bug fix (4) +29 / -11
Gate.phpBound policy discovery caching +14/-2

Bound policy discovery caching

• Accepts ordinary gate arguments and caches discovered policies only for actual classes, avoiding unbounded entries from arbitrary strings.

src/auth/src/Access/Gate.php

Repository.phpRoute flush through cache lifecycle handling +12/-1

Route flush through cache lifecycle handling

• Adds an explicit flush method delegating to clear so normal flushing emits success, failure, and cancellation-aware events; clarifies many-key defaults.

src/cache/src/Repository.php

RedisConnection.phpType nullable native Redis client +1/-3

Type nullable native Redis client

• Declares that client can return null after the connection closes.

src/redis/src/RedisConnection.php

Can.phpPreserve falsey authorization data +2/-5

Preserve falsey authorization data

• Passes configured arguments and the validated value to Gate without filtering falsey values.

src/validation/src/Rules/Can.php

Refactor (3) +75 / -6
ClearCommand.phpUse the repository flush contract +0/-1

Use the repository flush contract

• Removes a redundant type workaround now that flush is declared on the cache repository contract.

src/cache/src/Console/ClearCommand.php

SwallowedCancellationCollector.phpRemove obsolete Redis trait exception +0/-2

Remove obsolete Redis trait exception

• Simplifies declaring-class analysis now that Redis transaction helpers live directly on RedisProxy.

src/phpstan/src/Collectors/SwallowedCancellationCollector.php

RedisProxy.phpInline typed transaction helpers +75/-3

Inline typed transaction helpers

• Moves pipeline and transaction execution from its single-use trait onto the proxy, preserving cleanup and cancellation behavior while adding native return unions.

src/redis/src/RedisProxy.php

Tests (501) +14774 / -14132
AuthAccessGateTest.phpCover gate data and policy cache boundaries +28/-11

Cover gate data and policy cache boundaries

• Adds authorization regressions for ordinary arguments and real-class-only discovery caching.

tests/Auth/AuthAccessGateTest.php

benchmark.phpReplace benchmark Mockery fixtures +14/-14

Replace benchmark Mockery fixtures

• Uses Double and real provider objects for pooled-connection benchmark fixtures without changing measured operations.

tests/Benchmarks/PooledConnections/benchmark.php

RedisBroadcasterConnection.phpDeclare Redis broadcaster fixture commands +21/-0

Declare Redis broadcaster fixture commands

• Provides reflectable publish and eval signatures for a RedisProxy-based Double.

tests/Broadcasting/Fixtures/RedisBroadcasterConnection.php

RedisBroadcasterTest.phpConvert broadcaster expectations +8/-22

Convert broadcaster expectations

• Replaces direct Mockery fixtures with typed Doubles and Redis forwarding fixtures.

tests/Broadcasting/RedisBroadcasterTest.php

CacheEventsTest.phpCover clear and flush event parity +14/-6

Cover clear and flush event parity

• Runs success, failure, and cancellation assertions against both repository entry points.

tests/Cache/CacheEventsTest.php

ComponentsFactory.phpProvide concrete console component factory +11/-0

Provide concrete console component factory

• Adds a fixture in place of a directly mocked console component factory.

tests/Console/Fixtures/ComponentsFactory.php

ComposerAutoloadIsAuthoritativeTest.phpTest authoritative-autoload diagnostic +45/-0

Test authoritative-autoload diagnostic

• Covers production pass and failure results and the local-environment skip.

tests/Doctor/Feature/Diagnostics/ComposerAutoloadIsAuthoritativeTest.php

DoctorServiceProviderTest.phpVerify diagnostic registration +3/-0

Verify diagnostic registration

• Asserts Doctor registers the authoritative Composer autoload check.

tests/Doctor/Feature/DoctorServiceProviderTest.php

BaseClientTest.phpConvert gRPC client doubles +6/-3

Convert gRPC client doubles

• Migrates direct mocks to verified Double expectations.

tests/Grpc/BaseClientTest.php

ConnectionTest.phpConvert gRPC connection doubles +7/-4

Convert gRPC connection doubles

• Migrates connection dependencies to typed Double fixtures.

tests/Grpc/ConnectionTest.php

ExceptionMapperTest.phpConvert exception mapper doubles +21/-19

Convert exception mapper doubles

• Expresses mapper collaborators and call expectations with Double.

tests/Grpc/ExceptionMapperTest.php

GrpcOperationRunnerTest.phpConvert operation runner doubles +12/-9

Convert operation runner doubles

• Uses Double to verify operation execution and failure paths.

tests/Grpc/GrpcOperationRunnerTest.php

GrpcRouterTest.phpConvert router doubles +8/-5

Convert router doubles

• Replaces direct Mockery router fixtures with verified Doubles.

tests/Grpc/GrpcRouterTest.php

HandleCallTest.phpConvert call-handler doubles +21/-17

Convert call-handler doubles

• Uses Double for gRPC call handling dependencies and expectations.

tests/Grpc/HandleCallTest.php

ResponseFactoryTest.phpConvert response factory doubles +17/-13

Convert response factory doubles

• Reworks response-construction mocks as typed Doubles.

tests/Grpc/ResponseFactoryTest.php

ServerTest.phpConvert gRPC server doubles +16/-13

Convert gRPC server doubles

• Verifies server collaborator calls through Double.

tests/Grpc/ServerTest.php

HashFacadeTest.phpConvert hashing facade fixtures +10/-7

Convert hashing facade fixtures

• Replaces direct mocks while retaining facade-specific testing behavior.

tests/Hashing/HashFacadeTest.php

HasherTest.phpConvert hasher doubles +12/-12

Convert hasher doubles

• Uses verified Doubles for hashing collaborators.

tests/Hashing/HasherTest.php

SchemaTest.phpConvert schema test fixture +6/-3

Convert schema test fixture

• Replaces directly constructed Mockery dependencies with Double.

tests/Head/Feature/Schema/SchemaTest.php

UnitTestCase.phpCentralize real Redis forwarding fixture +43/-3

Centralize real Redis forwarding fixture

• Builds a shared Horizon Redis proxy, pool, connection, and native-client test path using partial and strict Doubles.

tests/Horizon/UnitTestCase.php

FailedJobsControllerTest.phpConvert failed-jobs controller doubles +18/-18

Convert failed-jobs controller doubles

• Moves controller dependency expectations to Double.

tests/Horizon/Unit/FailedJobsControllerTest.php

LockTest.phpConvert Horizon lock doubles +20/-26

Convert Horizon lock doubles

• Uses the shared Redis forwarding fixture and explicit lock expectations.

tests/Horizon/Unit/LockTest.php

RedisConnectorTest.phpConvert Redis connector fixtures +3/-3

Convert Redis connector fixtures

• Replaces direct Mockery connector setup with Double.

tests/Horizon/Unit/RedisConnectorTest.php

RedisHorizonCommandQueueTest.phpConvert command queue Redis fixtures +11/-20

Convert command queue Redis fixtures

• Tests commands through typed Redis forwarding and explicit expectations.

tests/Horizon/Unit/RedisHorizonCommandQueueTest.php

RedisMasterSupervisorRepositoryTest.phpConvert supervisor repository fixtures +6/-6

Convert supervisor repository fixtures

• Moves Redis interaction expectations to Double.

tests/Horizon/Unit/RedisMasterSupervisorRepositoryTest.php

RedisMetricsRepositoryTest.phpConvert metrics repository fixtures +12/-22

Convert metrics repository fixtures

• Uses typed Redis fixtures for metrics repository calls.

tests/Horizon/Unit/RedisMetricsRepositoryTest.php

RedisQueueTest.phpConvert Horizon queue fixtures +38/-41

Convert Horizon queue fixtures

• Replaces direct mocks with shared forwarding and native Redis doubles.

tests/Horizon/Unit/RedisQueueTest.php

RedisTagRepositoryTest.phpConvert tag repository fixture +3/-3

Convert tag repository fixture

• Uses a typed Double for the Redis dependency.

tests/Horizon/Unit/RedisTagRepositoryTest.php

RedisWorkloadRepositoryTest.phpConvert workload repository fixtures +11/-11

Convert workload repository fixtures

• Expresses Redis workload expectations through Double.

tests/Horizon/Unit/RedisWorkloadRepositoryTest.php

ScaleCommandTest.phpConvert scale command fixture +3/-3

Convert scale command fixture

• Replaces a direct mock with a verified Double.

tests/Horizon/Unit/ScaleCommandTest.php

UpdateJobMetricsTest.phpConvert metrics update fixtures +16/-16

Convert metrics update fixtures

• Uses typed Doubles for Redis-backed metrics calls.

tests/Horizon/Unit/UpdateJobMetricsTest.php

UsesClusterAwarePipelineTest.phpConvert cluster pipeline fixtures +9/-9

Convert cluster pipeline fixtures

• Exercises cluster-aware pipeline handling with Double-backed native clients.

tests/Horizon/Unit/UsesClusterAwarePipelineTest.php

HorizonRestartStrategyTest.phpConvert restart strategy doubles +20/-14

Convert restart strategy doubles

• Moves restart dependency and ordering expectations to Double.

tests/Horizon/Console/HorizonRestartStrategyTest.php

InstallCommandTest.phpConvert Horizon installer fixtures +6/-3

Convert Horizon installer fixtures

• Replaces direct mocks with verified Doubles.

tests/Horizon/Console/InstallCommandTest.php

SnapshotCommandTest.phpConvert snapshot command doubles +12/-9

Convert snapshot command doubles

• Uses Double for snapshot dependencies and call counts.

tests/Horizon/Console/SnapshotCommandTest.php

WorkCommandTest.phpConvert work command doubles +13/-14

Convert work command doubles

• Replaces direct Mockery setup with Double expectations.

tests/Horizon/Console/WorkCommandTest.php

HorizonConfigTest.phpConvert Horizon configuration doubles +25/-22

Convert Horizon configuration doubles

• Migrates configuration collaborator mocks to Double.

tests/Horizon/HorizonConfigTest.php

CurlStreamingHandlerTest.phpConvert streaming handler doubles +7/-4

Convert streaming handler doubles

• Replaces direct Mockery fixtures with verified Doubles.

tests/Http/Client/CurlStreamingHandlerTest.php

CoroutineStateTest.phpConvert coroutine-state fixture +6/-3

Convert coroutine-state fixture

• Uses Double for the Guzzle coroutine collaborator.

tests/Http/Client/Guzzle/CoroutineStateTest.php

HttpClientTest.phpConvert HTTP client doubles +34/-31

Convert HTTP client doubles

• Migrates client collaborators to Double while preserving request and response assertions.

tests/Http/HttpClientTest.php

HttpRequestTest.phpConvert HTTP request doubles +8/-6

Convert HTTP request doubles

• Uses typed Double expectations for request dependencies.

tests/Http/HttpRequestTest.php

HttpServiceProviderTest.phpConvert HTTP provider doubles +23/-22

Convert HTTP provider doubles

• Replaces directly created mocks in provider registration tests.

tests/Http/HttpServiceProviderTest.php

IterableStreamedResponseTest.phpConvert streamed response fixture +8/-5

Convert streamed response fixture

• Uses Double for streamed-response collaborators.

tests/Http/IterableStreamedResponseTest.php

RequestBridgeTest.phpConvert request bridge doubles +6/-3

Convert request bridge doubles

• Migrates request conversion fixtures to Double.

tests/HttpServer/RequestBridgeTest.php

ResponseBridgeTest.phpConvert response bridge suite +214/-205

Convert response bridge suite

• Reworks response bridge collaborators as typed Doubles while retaining conversion coverage.

tests/HttpServer/ResponseBridgeTest.php

ServerTest.phpConvert HTTP server suite +240/-248

Convert HTTP server suite

• Migrates extensive server lifecycle and request-handling expectations to Double.

tests/HttpServer/ServerTest.php

InterventionDriverTest.phpConvert image driver fixture +5/-2

Convert image driver fixture

• Uses Double for driver collaborators.

tests/Image/Drivers/InterventionDriverTest.php

ImageTest.phpConvert image processing doubles +42/-46

Convert image processing doubles

• Replaces direct Mockery objects with typed Doubles.

tests/Image/ImageTest.php

CheckSsrTest.phpConvert SSR check doubles +8/-5

Convert SSR check doubles

• Uses Double to verify SSR command interactions.

tests/Inertia/Commands/CheckSsrTest.php

StartSsrTest.phpConvert SSR start doubles +15/-12

Convert SSR start doubles

• Replaces direct mocks in SSR startup tests.

tests/Inertia/Commands/StartSsrTest.php

EntriesRepositoryTest.phpConvert entries repository fixture +6/-3

Convert entries repository fixture

• Uses a verified Double for repository dependencies.

tests/Inertia/DevTools/EntriesRepositoryTest.php

DirectiveTest.phpRemove redundant directive mock setup +0/-15

Remove redundant directive mock setup

• Drops an unused filesystem and compiler mock setup while preserving directive coverage through application fixtures.

tests/Inertia/DirectiveTest.php

InertiaServiceProviderTest.phpConvert Inertia provider doubles +14/-15

Convert Inertia provider doubles

• Migrates provider collaborator expectations to Double.

tests/Inertia/InertiaServiceProviderTest.php

ResponseTest.phpSimplify Inertia response fixture +2/-5

Simplify Inertia response fixture

• Removes unnecessary direct mocking in response tests.

tests/Inertia/ResponseTest.php

ConversationConcurrencyTestCase.phpConvert conversation concurrency fixture +5/-3

Convert conversation concurrency fixture

• Uses Double for the integration test case's direct mock.

tests/Integration/Ai/Database/ConversationConcurrencyTestCase.php

ConversationStorageTestCase.phpConvert conversation storage fixture +4/-2

Convert conversation storage fixture

• Replaces a directly constructed mock with Double.

tests/Integration/Ai/Database/ConversationStorageTestCase.php

EloquentUserProviderCacheTest.phpConvert cached user-provider doubles +60/-64

Convert cached user-provider doubles

• Preserves provider cache scenarios using explicit Double expectations.

tests/Integration/Auth/EloquentUserProviderCacheTest.php

BroadcastManagerTest.phpConvert broadcast manager fixtures +94/-121

Convert broadcast manager fixtures

• Migrates broadcaster and manager dependencies to typed Doubles.

tests/Integration/Broadcasting/BroadcastManagerTest.php

SendingBroadcastsViaAnonymousEventTest.phpConvert anonymous broadcast fixture +2/-4

Convert anonymous broadcast fixture

• Uses Double for a directly mocked broadcast dependency.

tests/Integration/Broadcasting/SendingBroadcastsViaAnonymousEventTest.php

FailoverStoreTest.phpConvert failover cache fixtures +124/-133

Convert failover cache fixtures

• Replaces compound Mockery interfaces with typed Doubles and explicit failure-event counts.

tests/Integration/Cache/FailoverStoreTest.php

MemoizedTaggedCacheTest.phpConvert tagged cache fixture +2/-1

Convert tagged cache fixture

• Replaces a direct mock with Double.

tests/Integration/Cache/MemoizedTaggedCacheTest.php

BenchmarkContextTest.phpConvert Redis benchmark-context fixture +5/-2

Convert Redis benchmark-context fixture

• Uses Double for benchmark-context dependencies.

tests/Integration/Cache/Redis/BenchmarkContextTest.php

ConcurrencyIntegrationTest.phpConvert Redis concurrency doubles +13/-10

Convert Redis concurrency doubles

• Expresses integration collaborators through Double while retaining real Redis coverage.

tests/Integration/Cache/Redis/ConcurrencyIntegrationTest.php

InvokeSerializedClosureCommandTest.phpConvert serialized-closure fixture +7/-5

Convert serialized-closure fixture

• Migrates direct mocking to a verified Double.

tests/Integration/Concurrency/Console/InvokeSerializedClosureCommandTest.php

EnvironmentDecryptCommandTest.phpConvert decrypt command doubles +10/-7

Convert decrypt command doubles

• Uses Double for command collaborators.

tests/Integration/Console/EnvironmentDecryptCommandTest.php

EnvironmentEncryptCommandTest.phpConvert encrypt command doubles +25/-21

Convert encrypt command doubles

• Migrates encryption command dependencies and assertions to Double.

tests/Integration/Console/EnvironmentEncryptCommandTest.php

JobSchedulingTest.phpConvert job scheduling fixture +7/-4

Convert job scheduling fixture

• Replaces direct Mockery setup with Double.

tests/Integration/Console/JobSchedulingTest.php

SchedulePauseCommandTest.phpConvert schedule pause doubles +12/-11

Convert schedule pause doubles

• Uses Double to verify scheduler pause interactions.

tests/Integration/Console/Scheduling/SchedulePauseCommandTest.php

ScheduleResumeCommandTest.phpConvert schedule resume doubles +13/-13

Convert schedule resume doubles

• Uses Double to verify scheduler resume interactions.

tests/Integration/Console/Scheduling/ScheduleResumeCommandTest.php

UniqueJobSchedulingTest.phpConvert unique scheduling fixture +8/-5

Convert unique scheduling fixture

• Replaces directly constructed mocks with Double.

tests/Integration/Console/UniqueJobSchedulingTest.php

EloquentModelLoadSumTest.phpConvert load-sum fixture +6/-3

Convert load-sum fixture

• Uses Double for a model loading collaborator.

tests/Integration/Database/EloquentModelLoadSumTest.php

EloquentWhereHasMorphTest.phpConvert morph-query fixture +6/-3

Convert morph-query fixture

• Replaces direct mocking with Double.

tests/Integration/Database/EloquentWhereHasMorphTest.php

PooledConnectionTest.phpConvert pooled connection doubles +13/-11

Convert pooled connection doubles

• Preserves database pool integration behavior with verified Doubles.

tests/Integration/Database/PooledConnectionTest.php

DatabasePoolHeartbeatTest.phpConvert SQLite heartbeat doubles +9/-6

Convert SQLite heartbeat doubles

• Uses Double for pool heartbeat dependencies.

tests/Integration/Database/Sqlite/DatabasePoolHeartbeatTest.php

InMemorySqliteSharedPdoTest.phpConvert shared PDO fixture +8/-7

Convert shared PDO fixture

• Replaces direct Mockery setup with Double.

tests/Integration/Database/Sqlite/InMemorySqliteSharedPdoTest.php

ReceiveFileTest.phpConvert file-receive fixture +6/-3

Convert file-receive fixture

• Uses Double for the directly mocked filesystem collaborator.

tests/Integration/Filesystem/ReceiveFileTest.php

ApiInstallCommandTest.phpConvert API install command doubles +17/-16

Convert API install command doubles

• Migrates installer dependency expectations to Double.

tests/Integration/Foundation/Console/ApiInstallCommandTest.php

BroadcastingInstallCommandTest.phpConvert broadcasting installer doubles +23/-25

Convert broadcasting installer doubles

• Uses Double for command filesystem and process collaborators.

tests/Integration/Foundation/Console/BroadcastingInstallCommandTest.php

ConfigClearCommandTest.phpConvert config-clear doubles +10/-7

Convert config-clear doubles

• Replaces directly constructed command mocks.

tests/Integration/Foundation/Console/ConfigClearCommandTest.php

ConfigPublishCommandTest.phpConvert config-publish doubles +10/-8

Convert config-publish doubles

• Migrates publish command collaborators to Double.

tests/Integration/Foundation/Console/ConfigPublishCommandTest.php

EventClearCommandTest.phpConvert event-clear doubles +10/-7

Convert event-clear doubles

• Uses Double for clear command dependencies.

tests/Integration/Foundation/Console/EventClearCommandTest.php

LangPublishCommandTest.phpConvert language-publish doubles +11/-8

Convert language-publish doubles

• Migrates publisher expectations to Double.

tests/Integration/Foundation/Console/LangPublishCommandTest.php

RouteClearCommandTest.phpConvert route-clear doubles +10/-7

Convert route-clear doubles

• Uses Double for direct command dependencies.

tests/Integration/Foundation/Console/RouteClearCommandTest.php

StorageCommandTest.phpConvert storage command doubles +19/-17

Convert storage command doubles

• Replaces Mockery collaborators with verified Doubles.

tests/Integration/Foundation/Console/StorageCommandTest.php

StubPublishCommandTest.phpConvert stub-publish doubles +11/-8

Convert stub-publish doubles

• Uses Double for publishing dependencies.

tests/Integration/Foundation/Console/StubPublishCommandTest.php

ViewClearCommandTest.phpConvert view-clear doubles +25/-25

Convert view-clear doubles

• Migrates view cache cleanup expectations to Double.

tests/Integration/Foundation/Console/ViewClearCommandTest.php

RenderBladeFilesTest.phpConvert Blade rendering fixture +6/-3

Convert Blade rendering fixture

• Replaces direct Mockery setup with Double.

tests/Integration/Foundation/Exceptions/RenderBladeFilesTest.php

InteractsWithAuthenticationTest.phpPreserve authentication helper tests +15/-19

Preserve authentication helper tests

• Converts direct mocks while retaining Mockery-backed framework authentication-helper behavior.

tests/Integration/Foundation/Testing/Concerns/InteractsWithAuthenticationTest.php

ComponentMakeCommandTest.phpConvert component generator fixture +6/-3

Convert component generator fixture

• Uses Double for generator collaborators.

tests/Integration/Generators/ComponentMakeCommandTest.php

MailMakeCommandTest.phpConvert mail generator doubles +11/-10

Convert mail generator doubles

• Migrates generator dependencies to Double.

tests/Integration/Generators/MailMakeCommandTest.php

NotificationMakeCommandTest.phpConvert notification generator doubles +11/-10

Convert notification generator doubles

• Uses verified Doubles for generator interactions.

tests/Integration/Generators/NotificationMakeCommandTest.php

DashboardStatsControllerTest.phpConvert dashboard controller doubles +19/-16

Convert dashboard controller doubles

• Migrates Horizon dashboard collaborators to Double.

tests/Integration/Horizon/Controller/DashboardStatsControllerTest.php

MonitoringControllerTest.phpConvert monitoring controller doubles +10/-7

Convert monitoring controller doubles

• Uses Double for monitoring dependencies.

tests/Integration/Horizon/Controller/MonitoringControllerTest.php

AutoScalerTest.phpConvert autoscaler doubles +14/-11

Convert autoscaler doubles

• Verifies scaling interactions through Double.

tests/Integration/Horizon/Feature/AutoScalerTest.php

ClearCommandTest.phpConvert Horizon clear-command doubles +20/-17

Convert Horizon clear-command doubles

• Migrates clear-command dependencies to Double.

tests/Integration/Horizon/Feature/ClearCommandTest.php

MarkJobAsCompleteTest.phpConvert completion-listener doubles +25/-24

Convert completion-listener doubles

• Uses verified Doubles for job completion interactions.

tests/Integration/Horizon/Feature/Listeners/MarkJobAsCompleteTest.php

StoreTagsForFailedTest.phpConvert failed-tag listener fixture +9/-6

Convert failed-tag listener fixture

• Replaces direct mocks with Double.

tests/Integration/Horizon/Feature/Listeners/StoreTagsForFailedTest.php

MasterSupervisorTest.phpConvert master supervisor doubles +27/-18

Convert master supervisor doubles

• Migrates supervisor lifecycle collaborators to Double.

tests/Integration/Horizon/Feature/MasterSupervisorTest.php

MetricsTest.phpConvert Horizon metrics doubles +34/-31

Convert Horizon metrics doubles

• Uses Double for metrics collection expectations.

tests/Integration/Horizon/Feature/MetricsTest.php

MonitorMasterSupervisorMemoryTest.phpConvert master memory monitor doubles +15/-12

Convert master memory monitor doubles

• Replaces direct mocking of monitoring dependencies.

tests/Integration/Horizon/Feature/MonitorMasterSupervisorMemoryTest.php

MonitorSupervisorMemoryTest.phpConvert supervisor memory monitor doubles +13/-10

Convert supervisor memory monitor doubles

• Uses Double for memory monitoring collaborators.

tests/Integration/Horizon/Feature/MonitorSupervisorMemoryTest.php

MonitorWaitTimesTest.phpConvert wait-time monitor doubles +22/-19

Convert wait-time monitor doubles

• Migrates monitoring expectations to Double.

tests/Integration/Horizon/Feature/MonitorWaitTimesTest.php

ProcessInspectorTest.phpConvert process inspector doubles +13/-10

Convert process inspector doubles

• Uses verified Doubles for process inspection.

tests/Integration/Horizon/Feature/ProcessInspectorTest.php

RedisPayloadTest.phpConvert Redis payload fixture +6/-3

Convert Redis payload fixture

• Replaces a direct mock with Double.

tests/Integration/Horizon/Feature/RedisPayloadTest.php

SupervisorTest.phpConvert supervisor fixture +8/-5

Convert supervisor fixture

• Uses Double for supervisor collaborators.

tests/Integration/Horizon/Feature/SupervisorTest.php

TrimFailedJobsTest.phpConvert failed-job trim doubles +10/-7

Convert failed-job trim doubles

• Verifies trimming dependencies with Double.

tests/Integration/Horizon/Feature/TrimFailedJobsTest.php

TrimMonitoredJobsTest.phpConvert monitored-job trim doubles +10/-7

Convert monitored-job trim doubles

• Uses Double for trimming interactions.

tests/Integration/Horizon/Feature/TrimMonitoredJobsTest.php

TrimRecentJobsTest.phpConvert recent-job trim doubles +10/-7

Convert recent-job trim doubles

• Replaces direct mocks in trimming tests.

tests/Integration/Horizon/Feature/TrimRecentJobsTest.php

WaitTimeCalculatorTest.phpConvert wait-time calculator doubles +17/-11

Convert wait-time calculator doubles

• Migrates wait-time dependency expectations to Double.

tests/Integration/Horizon/Feature/WaitTimeCalculatorTest.php

WorkerProcessTest.phpConvert worker-process doubles +33/-20

Convert worker-process doubles

• Uses Double for worker lifecycle expectations.

tests/Integration/Horizon/Feature/WorkerProcessTest.php

MailFailoverTransportTest.phpConvert failover mail fixture +5/-2

Convert failover mail fixture

• Uses Double for transport collaborators.

tests/Integration/Mail/MailFailoverTransportTest.php

MailLogTransportTest.phpConvert logging transport fixture +5/-2

Convert logging transport fixture

• Replaces direct mock construction with Double.

tests/Integration/Mail/MailLogTransportTest.php

MailManagerTest.phpConvert mail manager doubles +10/-7

Convert mail manager doubles

• Migrates transport manager dependencies to Double.

tests/Integration/Mail/MailManagerTest.php

MailRoundRobinTransportTest.phpConvert round-robin mail fixture +5/-2

Convert round-robin mail fixture

• Uses Double for transport dependencies.

tests/Integration/Mail/MailRoundRobinTransportTest.php

SendingQueuedMailTest.phpConvert queued-mail fixture +8/-5

Convert queued-mail fixture

• Replaces direct mocks with verified Doubles.

tests/Integration/Mail/SendingQueuedMailTest.php

SigningKeyConcurrencyTest.phpConvert signing-key concurrency doubles +9/-7

Convert signing-key concurrency doubles

• Retains Postgres concurrency coverage with Double fixtures.

tests/Integration/Passport/Database/Postgres/SigningKeyConcurrencyTest.php

DatabaseQueueReservationTest.phpConvert queue reservation doubles +11/-8

Convert queue reservation doubles

• Uses Double for SQLite reservation collaborators.

tests/Integration/Queue/Database/Sqlite/DatabaseQueueReservationTest.php

WorkerResourceLifetimeTest.phpConvert worker resource fixtures +47/-40

Convert worker resource fixtures

• Migrates SQLite worker lifetime dependencies and call assertions to Double.

tests/Integration/Queue/Database/Sqlite/WorkerResourceLifetimeTest.php

FailOnExceptionMiddlewareTest.phpConvert exception middleware fixture +6/-3

Convert exception middleware fixture

• Uses Double for the queue middleware dependency.

tests/Integration/Queue/FailOnExceptionMiddlewareTest.php

OutboxClaimTestCase.phpConvert shared outbox claim fixture +4/-2

Convert shared outbox claim fixture

• Replaces direct Mockery setup in the integration test base.

tests/Integration/Queue/Fixtures/OutboxClaimTestCase.php

RateLimitedRedisStoreTest.phpConvert Redis rate-limit fixtures +7/-5

Convert Redis rate-limit fixtures

• Uses typed Doubles around Redis rate-limiting behavior.

tests/Integration/Queue/Redis/RateLimitedRedisStoreTest.php

ThrottlesExceptionsTest.phpConvert exception throttle doubles +24/-16

Convert exception throttle doubles

• Migrates throttle cache expectations to Double.

tests/Integration/Queue/ThrottlesExceptionsTest.php

UniqueJobTest.phpConvert unique-job fixture +5/-2

Convert unique-job fixture

• Replaces direct mocking with Double.

tests/Integration/Queue/UniqueJobTest.php

WithoutOverlappingJobsTest.phpConvert overlap middleware doubles +12/-9

Convert overlap middleware doubles

• Uses verified Doubles for locking interactions.

tests/Integration/Queue/WithoutOverlappingJobsTest.php

RouteCachingTest.phpConvert route-cache doubles +17/-14

Convert route-cache doubles

• Migrates route caching dependencies to Double.

tests/Integration/Routing/RouteCachingTest.php

DatabaseVectorImportTest.phpConvert vector import fixture +6/-3

Convert vector import fixture

• Replaces direct mocking in Postgres vector import tests.

tests/Integration/Scout/Database/Postgres/DatabaseVectorImportTest.php

DatabaseSessionHandlerTestCase.phpConvert database session fixture +10/-7

Convert database session fixture

• Uses Double in the shared session handler test case.

tests/Integration/Session/Database/DatabaseSessionHandlerTestCase.php

RedisSessionHandlerTest.phpConvert Redis session integration doubles +11/-9

Convert Redis session integration doubles

• Migrates direct mocks while retaining Redis session behavior.

tests/Integration/Session/Redis/RedisSessionHandlerTest.php

MultipleInstanceManagerTest.phpConvert multiple-instance manager fixture +7/-4

Convert multiple-instance manager fixture

• Uses verified Double collaborators.

tests/Integration/Support/Multipl...

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

qodo-free-for-open-source-projects Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Server start tests stop before startup ⊘ Outdated
Description
ServerStartCommandTest configures setEventDispatcher() and setLogger() on a strict double
without returning the server factory. When startServer() chains those setters, the tests stop
before reaching the configuration and startup behavior they intend to verify.

2. Failed-job ID test breaks its query chain 🐞 Bug ≡ Correctness
Description
testNonIntegerFailedJobIdsAreCastToStrings() permits orderBy() on the strict builder double but
does not return that builder. When DatabaseFailedJobProvider::ids() chains
orderBy()->pluck('id'), the test cannot reach the ID-casting assertion through its configured
pluck() response.
Code

tests/Queue/DatabaseFailedJobProviderTest.php[73]

+        $builder->allows('orderBy');
Evidence
The converted test returns the builder from when() but not orderBy(); the provider immediately
calls pluck() on the result of orderBy().

tests/Queue/DatabaseFailedJobProviderTest.php[69-79]
src/queue/src/Failed/DatabaseFailedJobProvider.php[44-53]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The converted builder double does not preserve the fluent return needed by the failed-job provider's query.
## Fix Focus Areas
- tests/Queue/DatabaseFailedJobProviderTest.php[71-79]
## Recommended Fix
Configure the `orderBy` stub to return `$builder`, preserving the previous mock's `andReturnSelf()` behavior, and run the test.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. WebSocket test state leaks between tests 🐞 Bug ☼ Reliability
Description
WebSocketRuntimeContextTest removes its tearDown() calls to FdCollector::flushState() and
WebSocketContext::flushState(). Its message test registers descriptors 1 and 2 without closing
them, so those process-wide registrations remain after the test and can affect subsequent tests.
Code

tests/Sentry/WebSocketRuntimeContextTest.php[L283-286]

-    protected function tearDown(): void
-    {
-        FdCollector::flushState();
-        WebSocketContext::flushState();
Evidence
The test registers two descriptors; message handling reads their registrations but does not delete
them. FdCollector retains registrations in a static array until explicit deletion or flushing, and
the PR deletes the test's flush.

tests/Sentry/WebSocketRuntimeContextTest.php[129-136]
src/websocket-server/src/Server.php[299-314]
src/websocket-server/src/Collector/FdCollector.php[8-17]
src/websocket-server/src/Collector/FdCollector.php[59-65]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Removing the test's teardown leaves process-wide WebSocket descriptor and context state behind.
## Fix Focus Areas
- tests/Sentry/WebSocketRuntimeContextTest.php[275-287]
## Recommended Fix
Restore teardown that flushes both `FdCollector` and `WebSocketContext` and calls `parent::tearDown()`, regardless of whether a test succeeds or fails.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Case variants of a class name still grow the policy cache ✓ Resolved
Description
getPolicyFor() now caches only when class_exists($class, false) is true, but it keys the cache
by the caller's raw string. class_exists matches class names case-insensitively, so
App\Models\Post, app\models\post, APP\MODELS\POST and so on each pass the check and each get
their own policyClassCache entry. If a gate's first argument comes from request data (for example
a Can rule with no fixed arguments, where the validated value becomes $arguments[0]), a client
can send many casings of any loaded class name and keep growing worker memory. That is the unbounded
growth this change is meant to stop.

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5 Tier: plus

[Medium impact] Most changes affect test setup, with bounded changes to authorization, caching, Redis, and production diagnostics.

The previous policy-binding finding remains partly unfixed and should be addressed before merging.

Fix All in Claude CodeFindings

  1. P1 Configured policies are ignored ▶

Summary

Converts remaining direct Mockery doubles to Double across framework tests and benchmark fixtures.

  • Authorization callbacks keep every argument in order and resolve policies by their declared names.
  • Cache repositories expose shared operations, and flush() follows the clear lifecycle.
  • Production Doctor checks whether Composer uses an authoritative class map.
  • Redis proxy methods now own pipeline and transaction behavior directly.
  • The components development setup requires PhpRedis 6.3 or newer.
  • Framework tests use stricter doubles and controlled real clients where direct mocks were unnecessary.

Reviews (3) · Last reviewed commit: "Preserve configured policy names for dec..." · Reviewed by Greptile

Comment thread src/validation/src/Rules/Can.php Resolved
The components checkout needs a newer native Redis client for test doubles than published packages require. Check that its ext-redis range is contained within the split requirement instead of demanding equality for this one dependency. Keep exact equality for every other dependency and record removal with the deferred framework-wide bump.

Validation: reproduced the CI manifest failure, then passed the complete manifest checks. Full analysis and formatting pass.
Reindex the arguments collected by Rule::can before appending the validated value. Named variadic arguments otherwise reach Gate before a positional value and raise an unpacking error. Preserve falsey authorization data.

Validation: the named-factory regression fails before this correction and passes afterward. Validation Can, Data attribute and affected Gate consumer tests pass; full analysis and formatting pass.
Admit only declared model class names to the policy cache, leaving original argument spelling available to discovery hooks. Resolve guessed policy classes by their declared name so case and leading-backslash variants cannot bypass canonical bindings or grow separate container instances. Normal canonical cache hits do no additional work.

Validation: regressions fail before the correction and pass afterward. Auth, query-aware policies on PostgreSQL, Foundation authorization, Permission, Telescope and policy consistency consumers pass; full analysis and formatting pass.
Choose the autoload optimization flag from the current Composer loader when regenerating files. Keep the displayed repair command consistent with execution, so repairing validity does not silently disable authoritative class lookup. Leave development-package selection and the read-only validity probe unchanged.

Validation: both loader modes and relocated vendor coverage pass after reproducing the regression. The Doctor suite, full analysis and formatting pass.
@binaryfire

Copy link
Copy Markdown
Member Author

Qodo review dispositions:

  1. Server factory setters already return the double: both methods have native static return types, and Double supplies the receiver for those types. The startup tests pass without explicit return configuration.
  2. orderBy() likewise has a native static return type, so the configured double preserves the query chain. The ID-casting test passes.
  3. WebSocket state cleanup is owned by AfterEachTestSubscriber, which already calls both FdCollector::flushState() and WebSocketServer\Context::flushState(). Restoring per-test duplicates is unnecessary.
  4. Fixed in a0dda4d: cache admission requires declared class spelling, and guessed policy classes use their declared names for container resolution. Regression coverage verifies binding reuse and unchanged guesser inputs.

Comment thread src/auth/src/Access/Gate.php Outdated
return $guessedPolicy;
// Loaded classes match case-insensitively; use the declared name so input spelling
// cannot bypass its container binding or create separate policy instances.
return (new ReflectionClass($guessedPolicy))->getName();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Configured policies are ignored

When guessPolicyNamesUsing() returns a PHP class alias with an explicit container binding, ReflectionClass::getName() replaces it with the original class name. resolvePolicy() then resolves that original name and ignores the configured policy instance. Authorization may return a different result.

Honor an explicit binding for the guessed name before normalizing unbound spellings.

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.

Fixed in 6ddba98. Declared model classes now preserve the guessed policy name, so bindings, aliases, extenders and contextual configuration resolve normally. Only guesses from other inputs are normalized to keep worker state bounded. The regression uses a real PHP alias with an extender and fails without the fix. The source comment explains the narrow alias-input tradeoff and explicit policy mappings for those configurations.

Classify model input once on a policy-cache miss. Preserve guessed policy names for declared classes so container aliases, bindings, extenders and contextual dependencies retain their configured behavior. Normalize guesses only for other inputs to prevent request spellings from growing worker state.

Keep cache admission tied to declared names and explain the deliberate tradeoff for unusual PHP alias inputs beside the decision. Explicit policy mappings remain the direct path for those configurations. No container introspection or extra cache representation is needed.

Validation: the alias-extender regression fails before the change and passes afterward. Auth and Can-rule tests, Foundation authorization, Permission, Telescope, policy-consistency consumers and PostgreSQL policy queries pass. Full static analysis and formatting pass.
@binaryfire
binaryfire merged commit a6f8561 into 0.4 Nov 17, 2026
53 of 54 checks passed
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