Skip to content

Complete the framework test conversion to Double - #112

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 JMac Double and fix Gate policy resolution

  • Migrates the remaining test suites from Mockery to JMac Testing: strict and passthrough doubles, the VerifiesDoubles PHPUnit trait, and the new expects/allows/Argument APIs across Queue, Redis, Scout, Passport, Sentry, Grpc, OpenTelemetry, and other test areas. Several suites also replace mocked containers and configuration repositories with concrete instances.
  • Fixes Gate policy resolution in Gate.php: policy caching now applies only to declared class names, and first arguments that are neither objects nor strings are excluded from policy identification.
  • Fixes the validation Can rule in Can.php to pass all configured argument values, including falsey ones, to Gate in positional order.
  • Replaces the deleted MultiExec trait with pipeline/transaction methods and a private executeMultiExec helper on RedisProxy.php; RedisConnection::client now declares a Redis|RedisCluster|null return type.
  • Adds the ComposerAutoloadIsAuthoritative doctor diagnostic, raises the ext-redis constraint to ^6.3 in composer.json, expands the cache Repository contract with typed retrieval and putMany/flush, and documents production autoloader optimization.
  • Behavioral Change: RedisProxy multi-exec now clears transaction watch state after a successful callback transaction, invalidates the context connection on exceptions, and releases newly created context connections; ext-redis ^6.3 is now required.

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.
Reuse the existing typed console component fixture for task and two-column output rather than introducing duplicate helpers. Convert command and action mocks to strict doubles, retaining filesystem failures, pretend behavior, server lifecycle cleanup, and exact prompt responses.

Validation: every changed test file and Console ConfiguresPromptsTest passed. The package-mode Testbench suite passed with 679 tests, 2068 assertions, and three skips. Full static analysis and formatting passed.
Preserve migration ownership, rollback ordering, bootstrap failures, and process-envelope coverage with strict doubles. Use existing application objects where no mock behavior is needed, keep environment cleanup exception-safe, and document Symfony's destructor stop allowance.

Validation: each changed test file passed, as did composer test:testbench (679 tests, 2068 assertions, three skips), full static analysis, and formatting.
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.
@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 conversion to Double

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

Grey Divider

AI Description

• Convert remaining direct Mockery test doubles to Double while preserving framework mocking APIs
 and meaningful expectations.
• Fix authorization arguments and policy caching, cache flush events, Redis types, and transaction
 helper placement.
• Add a production Composer autoload diagnostic, deployment guidance, and a development-only
 PhpRedis requirement.
Diagram

graph TD
  Suite["Framework tests"] --> Doubles["Verified Doubles"] --> Fixtures["Native fixtures"]
  Suite --> Framework["Framework services"]
  Framework --> Gate["Gate policies"]
  Framework --> Cache["Cache lifecycle"]
  Framework --> Redis["Redis proxy"]
  Framework --> Doctor["Doctor diagnostic"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Split production fixes from the test conversion
  • ➕ Allows focused review and rollback of behavioral changes
  • ➕ Separates contract compatibility risks from mechanical test changes
  • ➖ Requires coordinating dependent fixture and regression-test changes across PRs

Recommendation: Keep the Double conversion and its native fixtures together, but consider separating the authorization, cache, and Doctor behavior changes if review or release timing permits. Retaining Mockery behind framework-provided testing APIs is appropriate; replacing those APIs would alter the subject under test.

Files changed (519) +15112 / -14157

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

Declare shared cache operations

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

src/contracts/src/Cache/Repository.php

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

Check production Composer class maps

• Skips local environments and passes or fails production checks based on Composer's authoritative-class-map setting, with remediation guidance.

src/doctor/src/Diagnostics/ComposerAutoloadIsAuthoritative.php

DoctorServiceProvider.phpRegister autoload diagnostic +2/-0

Register autoload diagnostic

• Makes the new Composer diagnostic available through Doctor.

src/doctor/src/DoctorServiceProvider.php

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

Bound policy discovery caching

• Accepts ordinary gate arguments and caches policy discoveries only for real classes, preventing unbounded caching of arbitrary strings.

src/auth/src/Access/Gate.php

ClearCommand.phpUse repository flush behavior +0/-1

Use repository flush behavior

• Removes the command's workaround now that repository flush handles lifecycle events.

src/cache/src/Console/ClearCommand.php

Repository.phpRoute flush through clear +12/-1

Route flush through clear

• Adds explicit flush forwarding so normal flushes emit the same success and failure events as clear; documents many-key defaults.

src/cache/src/Repository.php

RedisConnection.phpType nullable native client +1/-3

Type nullable native client

• Declares that client() returns Redis, RedisCluster, or null after a connection closes.

src/redis/src/RedisConnection.php

Can.phpPreserve falsey authorization arguments +2/-5

Preserve falsey authorization arguments

• Passes every supplied argument and validated value to Gate without filtering falsey data.

src/validation/src/Rules/Can.php

Refactor (2) +75 / -5
SwallowedCancellationCollector.phpRemove obsolete trait exception +0/-2

Remove obsolete trait exception

• Drops the Redis transaction trait special case after its methods move onto RedisProxy.

src/phpstan/src/Collectors/SwallowedCancellationCollector.php

RedisProxy.phpInline transaction and pipeline helpers +75/-3

Inline transaction and pipeline helpers

• Moves the sole-use MultiExec implementation onto the proxy and declares native return unions while preserving cleanup and cancellation behavior.

src/redis/src/RedisProxy.php

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

Cover gate data and policy caching

• Tests ordinary gate arguments and bounded policy discovery while converting direct mocks to verified Doubles.

tests/Auth/AuthAccessGateTest.php

benchmark.phpConvert pooled benchmark fixtures +14/-14

Convert pooled benchmark fixtures

• Replaces direct Mockery fixtures with Doubles or real Ably and Mercure objects without changing benchmark operations.

tests/Benchmarks/PooledConnections/benchmark.php

RedisBroadcasterConnection.phpDeclare broadcaster Redis commands +21/-0

Declare broadcaster Redis commands

• Provides a typed RedisProxy fixture whose dynamic publish and eval commands can be reflected by Double.

tests/Broadcasting/Fixtures/RedisBroadcasterConnection.php

RedisBroadcasterTest.phpConvert Redis broadcaster tests +8/-22

Convert Redis broadcaster tests

• Uses typed, verified Doubles and the broadcaster connection fixture instead of direct Mockery mocks.

tests/Broadcasting/RedisBroadcasterTest.php

CacheEventsTest.phpCover both cache flush entry points +14/-6

Cover both cache flush entry points

• Runs success, failure, and cancellation assertions for both clear and flush.

tests/Cache/CacheEventsTest.php

ComponentsFactory.phpAdd console components fixture +11/-0

Add console components fixture

• Provides a concrete test fixture for component creation during Double conversion.

tests/Console/Fixtures/ComponentsFactory.php

ComposerAutoloadIsAuthoritativeTest.phpTest Composer autoload diagnostic +45/-0

Test Composer autoload diagnostic

• Covers local skipping and production authoritative versus non-authoritative results.

tests/Doctor/Feature/Diagnostics/ComposerAutoloadIsAuthoritativeTest.php

DoctorServiceProviderTest.phpAssert diagnostic registration +3/-0

Assert diagnostic registration

• Verifies the new Composer class-map diagnostic is registered.

tests/Doctor/Feature/DoctorServiceProviderTest.php

BaseClientTest.phpConvert base client doubles +6/-3

Convert base client doubles

• Replaces directly created Mockery dependencies with verified Doubles.

tests/Grpc/BaseClientTest.php

ConnectionTest.phpConvert gRPC connection doubles +7/-4

Convert gRPC connection doubles

• Uses verified Doubles for connection collaborators.

tests/Grpc/ConnectionTest.php

ExceptionMapperTest.phpConvert exception mapper doubles +21/-19

Convert exception mapper doubles

• Migrates mapper test collaborators to verified Doubles while retaining mapping assertions.

tests/Grpc/ExceptionMapperTest.php

GrpcOperationRunnerTest.phpConvert operation runner doubles +12/-9

Convert operation runner doubles

• Uses verified Doubles for gRPC operation dependencies.

tests/Grpc/GrpcOperationRunnerTest.php

GrpcRouterTest.phpConvert router doubles +8/-5

Convert router doubles

• Replaces direct Mockery router collaborators with verified Doubles.

tests/Grpc/GrpcRouterTest.php

HandleCallTest.phpConvert call handler doubles +21/-17

Convert call handler doubles

• Migrates gRPC call expectations to verified Doubles.

tests/Grpc/HandleCallTest.php

ResponseFactoryTest.phpConvert response factory doubles +17/-13

Convert response factory doubles

• Uses Double for response construction dependencies and expectations.

tests/Grpc/ResponseFactoryTest.php

ServerTest.phpConvert gRPC server doubles +16/-13

Convert gRPC server doubles

• Replaces directly constructed Mockery server collaborators with verified Doubles.

tests/Grpc/ServerTest.php

HashFacadeTest.phpConvert hash facade test dependencies +10/-7

Convert hash facade test dependencies

• Uses verified Doubles where tests directly construct hashing collaborators.

tests/Hashing/HashFacadeTest.php

HasherTest.phpConvert hasher doubles +12/-12

Convert hasher doubles

• Migrates hasher expectations from direct Mockery mocks to Double.

tests/Hashing/HasherTest.php

SchemaTest.phpConvert schema test doubles +6/-3

Convert schema test doubles

• Uses verified Doubles for directly mocked schema dependencies.

tests/Head/Feature/Schema/SchemaTest.php

UnitTestCase.phpAdd real Horizon Redis forwarding fixture +43/-3

Add real Horizon Redis forwarding fixture

• Builds a partially doubled RedisProxy, pool, connection, and native client, with automatic Double verification.

tests/Horizon/UnitTestCase.php

HorizonRestartStrategyTest.phpConvert restart strategy doubles +20/-14

Convert restart strategy doubles

• Migrates Horizon restart expectations to verified Doubles.

tests/Horizon/Console/HorizonRestartStrategyTest.php

InstallCommandTest.phpConvert Horizon installer doubles +6/-3

Convert Horizon installer doubles

• Replaces directly created Mockery collaborators with Double.

tests/Horizon/Console/InstallCommandTest.php

SnapshotCommandTest.phpConvert snapshot command doubles +12/-9

Convert snapshot command doubles

• Uses verified Doubles for command collaborators.

tests/Horizon/Console/SnapshotCommandTest.php

WorkCommandTest.phpConvert Horizon work command doubles +13/-14

Convert Horizon work command doubles

• Migrates directly mocked worker collaborators to Double.

tests/Horizon/Console/WorkCommandTest.php

HorizonConfigTest.phpConvert Horizon configuration doubles +25/-22

Convert Horizon configuration doubles

• Uses verified Doubles for configuration test dependencies.

tests/Horizon/HorizonConfigTest.php

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

Convert failed-jobs controller doubles

• Uses verified Doubles for Horizon controller dependencies.

tests/Horizon/Unit/FailedJobsControllerTest.php

LockTest.phpConvert Horizon lock doubles +20/-26

Convert Horizon lock doubles

• Reworks lock expectations with verified Doubles and native Redis fixtures.

tests/Horizon/Unit/LockTest.php

RedisConnectorTest.phpConvert Horizon connector doubles +3/-3

Convert Horizon connector doubles

• Uses Double for Redis connector dependencies.

tests/Horizon/Unit/RedisConnectorTest.php

RedisHorizonCommandQueueTest.phpConvert Horizon command-queue doubles +11/-20

Convert Horizon command-queue doubles

• Uses typed Redis forwarding and verified client expectations.

tests/Horizon/Unit/RedisHorizonCommandQueueTest.php

RedisMasterSupervisorRepositoryTest.phpConvert master supervisor Redis doubles +6/-6

Convert master supervisor Redis doubles

• Migrates repository Redis expectations to verified Doubles.

tests/Horizon/Unit/RedisMasterSupervisorRepositoryTest.php

RedisMetricsRepositoryTest.phpConvert Horizon metrics Redis doubles +12/-22

Convert Horizon metrics Redis doubles

• Uses the shared native-client forwarding fixture for metrics assertions.

tests/Horizon/Unit/RedisMetricsRepositoryTest.php

RedisQueueTest.phpConvert Horizon Redis queue doubles +38/-41

Convert Horizon Redis queue doubles

• Migrates Redis queue behavior assertions to verified Doubles and forwarding fixtures.

tests/Horizon/Unit/RedisQueueTest.php

RedisTagRepositoryTest.phpConvert Horizon tag Redis doubles +3/-3

Convert Horizon tag Redis doubles

• Uses verified Doubles for tag repository Redis operations.

tests/Horizon/Unit/RedisTagRepositoryTest.php

RedisWorkloadRepositoryTest.phpConvert workload Redis doubles +11/-11

Convert workload Redis doubles

• Migrates workload repository expectations to Double.

tests/Horizon/Unit/RedisWorkloadRepositoryTest.php

ScaleCommandTest.phpConvert scale command doubles +3/-3

Convert scale command doubles

• Replaces directly created Mockery dependencies with verified Doubles.

tests/Horizon/Unit/ScaleCommandTest.php

UpdateJobMetricsTest.phpConvert job metrics doubles +16/-16

Convert job metrics doubles

• Uses verified Doubles for metrics update dependencies.

tests/Horizon/Unit/UpdateJobMetricsTest.php

UsesClusterAwarePipelineTest.phpConvert cluster pipeline doubles +9/-9

Convert cluster pipeline doubles

• Tests cluster-aware pipeline behavior through typed Redis forwarding fixtures.

tests/Horizon/Unit/UsesClusterAwarePipelineTest.php

CurlStreamingHandlerTest.phpConvert curl streaming doubles +7/-4

Convert curl streaming doubles

• Migrates directly created handler collaborators to verified Doubles.

tests/Http/Client/CurlStreamingHandlerTest.php

CoroutineStateTest.phpConvert Guzzle state doubles +6/-3

Convert Guzzle state doubles

• Uses verified Doubles for coroutine-state test dependencies.

tests/Http/Client/Guzzle/CoroutineStateTest.php

HttpClientTest.phpConvert HTTP client doubles +34/-31

Convert HTTP client doubles

• Replaces direct Mockery HTTP dependencies with verified Doubles.

tests/Http/HttpClientTest.php

HttpRequestTest.phpConvert HTTP request doubles +8/-6

Convert HTTP request doubles

• Migrates directly constructed request collaborators to Double.

tests/Http/HttpRequestTest.php

HttpServiceProviderTest.phpConvert HTTP provider doubles +23/-22

Convert HTTP provider doubles

• Uses verified Doubles for service-provider dependencies.

tests/Http/HttpServiceProviderTest.php

IterableStreamedResponseTest.phpConvert streamed response doubles +8/-5

Convert streamed response doubles

• Uses Double to verify streamed response collaborators.

tests/Http/IterableStreamedResponseTest.php

RequestBridgeTest.phpConvert request bridge doubles +6/-3

Convert request bridge doubles

• Migrates request bridge collaborators to verified Doubles.

tests/HttpServer/RequestBridgeTest.php

ResponseBridgeTest.phpConvert response bridge doubles +214/-205

Convert response bridge doubles

• Replaces direct Mockery response and transport fixtures with verified Doubles.

tests/HttpServer/ResponseBridgeTest.php

ServerTest.phpConvert HTTP server doubles +240/-248

Convert HTTP server doubles

• Migrates server lifecycle and request-handling expectations to verified Doubles.

tests/HttpServer/ServerTest.php

InterventionDriverTest.phpConvert image driver doubles +5/-2

Convert image driver doubles

• Uses Double for directly mocked image-driver collaborators.

tests/Image/Drivers/InterventionDriverTest.php

ImageTest.phpConvert image processing doubles +42/-46

Convert image processing doubles

• Migrates image tests to verified Doubles while retaining processing assertions.

tests/Image/ImageTest.php

CheckSsrTest.phpConvert SSR check doubles +8/-5

Convert SSR check doubles

• Uses verified Doubles for SSR check command collaborators.

tests/Inertia/Commands/CheckSsrTest.php

StartSsrTest.phpConvert SSR start doubles +15/-12

Convert SSR start doubles

• Migrates SSR process expectations to verified Doubles.

tests/Inertia/Commands/StartSsrTest.php

EntriesRepositoryTest.phpConvert entries repository doubles +6/-3

Convert entries repository doubles

• Uses Double for directly mocked development-tool dependencies.

tests/Inertia/DevTools/EntriesRepositoryTest.php

DirectiveTest.phpRemove redundant directive coverage +0/-15

Remove redundant directive coverage

• Drops a duplicate Inertia directive test while retaining distinct coverage.

tests/Inertia/DirectiveTest.php

InertiaServiceProviderTest.phpConvert Inertia provider doubles +14/-15

Convert Inertia provider doubles

• Uses verified Doubles for provider dependencies.

tests/Inertia/InertiaServiceProviderTest.php

ResponseTest.phpSimplify Inertia response fixtures +2/-5

Simplify Inertia response fixtures

• Removes unnecessary direct mocking in response tests.

tests/Inertia/ResponseTest.php

ConversationConcurrencyTestCase.phpConvert conversation concurrency fixtures +5/-3

Convert conversation concurrency fixtures

• Uses Double for directly mocked database concurrency dependencies.

tests/Integration/Ai/Database/ConversationConcurrencyTestCase.php

ConversationStorageTestCase.phpConvert conversation storage fixtures +4/-2

Convert conversation storage fixtures

• Migrates storage test collaborators to verified Doubles.

tests/Integration/Ai/Database/ConversationStorageTestCase.php

EloquentUserProviderCacheTest.phpConvert provider cache doubles +60/-64

Convert provider cache doubles

• Uses verified Doubles for user-provider cache interactions.

tests/Integration/Auth/EloquentUserProviderCacheTest.php

BroadcastManagerTest.phpConvert broadcast manager doubles +94/-121

Convert broadcast manager doubles

• Migrates broadcaster collaborator expectations to verified Doubles.

tests/Integration/Broadcasting/BroadcastManagerTest.php

SendingBroadcastsViaAnonymousEventTest.phpSimplify anonymous broadcast fixtures +2/-4

Simplify anonymous broadcast fixtures

• Uses real objects or Double in place of direct Mockery setup.

tests/Integration/Broadcasting/SendingBroadcastsViaAnonymousEventTest.php

FailoverStoreTest.phpConvert failover store doubles +124/-133

Convert failover store doubles

• Uses verified Doubles to exercise primary, fallback, and failure paths.

tests/Integration/Cache/FailoverStoreTest.php

MemoizedTaggedCacheTest.phpConvert tagged-cache fixture +2/-1

Convert tagged-cache fixture

• Replaces a directly created Mockery collaborator with Double.

tests/Integration/Cache/MemoizedTaggedCacheTest.php

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

Convert Redis benchmark context doubles

• Uses verified Doubles for context dependencies.

tests/Integration/Cache/Redis/BenchmarkContextTest.php

ConcurrencyIntegrationTest.phpConvert Redis concurrency doubles +13/-10

Convert Redis concurrency doubles

• Preserves integration behavior while replacing directly mocked collaborators.

tests/Integration/Cache/Redis/ConcurrencyIntegrationTest.php

InvokeSerializedClosureCommandTest.phpConvert closure command doubles +7/-5

Convert closure command doubles

• Uses verified Doubles for serialized-closure command dependencies.

tests/Integration/Concurrency/Console/InvokeSerializedClosureCommandTest.php

EnvironmentDecryptCommandTest.phpConvert decrypt command doubles +10/-7

Convert decrypt command doubles

• Migrates environment-decryption collaborators to Double.

tests/Integration/Console/EnvironmentDecryptCommandTest.php

EnvironmentEncryptCommandTest.phpConvert encrypt command doubles +25/-21

Convert encrypt command doubles

• Uses verified Doubles for encryption command expectations.

tests/Integration/Console/EnvironmentEncryptCommandTest.php

JobSchedulingTest.phpConvert scheduling doubles +7/-4

Convert scheduling doubles

• Replaces directly mocked scheduler collaborators with Double.

tests/Integration/Console/JobSchedulingTest.php

SchedulePauseCommandTest.phpConvert schedule-pause doubles +12/-11

Convert schedule-pause doubles

• Uses verified Doubles for pause command expectations.

tests/Integration/Console/Scheduling/SchedulePauseCommandTest.php

ScheduleResumeCommandTest.phpConvert schedule-resume doubles +13/-13

Convert schedule-resume doubles

• Uses verified Doubles for resume command expectations.

tests/Integration/Console/Scheduling/ScheduleResumeCommandTest.php

UniqueJobSchedulingTest.phpConvert unique scheduling doubles +8/-5

Convert unique scheduling doubles

• Migrates scheduling test collaborators to Double.

tests/Integration/Console/UniqueJobSchedulingTest.php

EloquentModelLoadSumTest.phpConvert load-sum test doubles +6/-3

Convert load-sum test doubles

• Uses verified Doubles for directly mocked model dependencies.

tests/Integration/Database/EloquentModelLoadSumTest.php

EloquentWhereHasMorphTest.phpConvert morph-query test doubles +6/-3

Convert morph-query test doubles

• Replaces direct Mockery setup with Double.

tests/Integration/Database/EloquentWhereHasMorphTest.php

PooledConnectionTest.phpConvert pooled database doubles +13/-11

Convert pooled database doubles

• Uses verified Doubles for pooled connection expectations.

tests/Integration/Database/PooledConnectionTest.php

DatabasePoolHeartbeatTest.phpConvert SQLite heartbeat doubles +9/-6

Convert SQLite heartbeat doubles

• Uses verified Doubles around pool heartbeat dependencies.

tests/Integration/Database/Sqlite/DatabasePoolHeartbeatTest.php

InMemorySqliteSharedPdoTest.phpConvert shared PDO test doubles +8/-7

Convert shared PDO test doubles

• Migrates directly mocked shared-connection collaborators to Double.

tests/Integration/Database/Sqlite/InMemorySqliteSharedPdoTest.php

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

Convert file-receive doubles

• Uses verified Doubles for file reception dependencies.

tests/Integration/Filesystem/ReceiveFileTest.php

ApiInstallCommandTest.phpConvert API installer doubles +17/-16

Convert API installer doubles

• Migrates installation command expectations to verified Doubles.

tests/Integration/Foundation/Console/ApiInstallCommandTest.php

BroadcastingInstallCommandTest.phpConvert broadcasting installer doubles +23/-25

Convert broadcasting installer doubles

• Uses verified Doubles for installation dependencies.

tests/Integration/Foundation/Console/BroadcastingInstallCommandTest.php

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

Convert config-clear doubles

• Uses Double for command filesystem or cache collaborators.

tests/Integration/Foundation/Console/ConfigClearCommandTest.php

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

Convert config-publish doubles

• Migrates publish command expectations to Double.

tests/Integration/Foundation/Console/ConfigPublishCommandTest.php

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

Convert event-clear doubles

• Uses verified Doubles for event cache cleanup dependencies.

tests/Integration/Foundation/Console/EventClearCommandTest.php

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

Convert language-publish doubles

• Migrates publish command collaborators to Double.

tests/Integration/Foundation/Console/LangPublishCommandTest.php

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

Convert route-clear doubles

• Uses verified Doubles for route-cache cleanup dependencies.

tests/Integration/Foundation/Console/RouteClearCommandTest.php

StorageCommandTest.phpConvert storage command doubles +19/-17

Convert storage command doubles

• Uses verified Doubles for storage command interactions.

tests/Integration/Foundation/Console/StorageCommandTest.php

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

Convert stub-publish doubles

• Migrates stub publishing dependencies to Double.

tests/Integration/Foundation/Console/StubPublishCommandTest.php

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

Convert view-clear doubles

• Uses verified Doubles for view cache cleanup expectations.

tests/Integration/Foundation/Console/ViewClearCommandTest.php

RenderBladeFilesTest.phpConvert Blade exception fixtures +6/-3

Convert Blade exception fixtures

• Uses verified Doubles for directly mocked rendering dependencies.

tests/Integration/Foundation/Exceptions/RenderBladeFilesTest.php

InteractsWithAuthenticationTest.phpPreserve authentication helper mocking +15/-19

Preserve authentication helper mocking

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

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

ComponentMakeCommandTest.phpConvert component generator doubles +6/-3

Convert component generator doubles

• Uses verified Doubles for generator collaborators.

tests/Integration/Generators/ComponentMakeCommandTest.php

MailMakeCommandTest.phpConvert mail generator doubles +11/-10

Convert mail generator doubles

• Migrates directly mocked 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 stats doubles +19/-16

Convert dashboard stats doubles

• Migrates controller repository expectations to Double.

tests/Integration/Horizon/Controller/DashboardStatsControllerTest.php

MonitoringControllerTest.phpConvert monitoring controller doubles +10/-7

Convert monitoring controller doubles

• Uses verified Doubles for monitoring data dependencies.

tests/Integration/Horizon/Controller/MonitoringControllerTest.php

AutoScalerTest.phpConvert autoscaler doubles +14/-11

Convert autoscaler doubles

• Migrates autoscaling collaborator expectations to Double.

tests/Integration/Horizon/Feature/AutoScalerTest.php

ClearCommandTest.phpConvert Horizon clear doubles +20/-17

Convert Horizon clear doubles

• Uses verified Doubles for clearing Horizon state.

tests/Integration/Horizon/Feature/ClearCommandTest.php

MarkJobAsCompleteTest.phpConvert completion listener doubles +25/-24

Convert completion listener doubles

• Migrates completion listener dependencies to Double.

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

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

Convert failed-tag listener doubles

• Uses verified Doubles for failed-job tagging.

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

MasterSupervisorTest.phpConvert master supervisor doubles +27/-18

Convert master supervisor doubles

• Migrates supervisor lifecycle expectations to verified Doubles.

tests/Integration/Horizon/Feature/MasterSupervisorTest.php

MetricsTest.phpConvert Horizon metrics doubles +34/-31

Convert Horizon metrics doubles

• Uses verified Doubles for metrics behavior.

tests/Integration/Horizon/Feature/MetricsTest.php

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

Convert master memory-monitor doubles

• Migrates memory monitor collaborators to Double.

tests/Integration/Horizon/Feature/MonitorMasterSupervisorMemoryTest.php

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

Convert supervisor memory-monitor doubles

• Uses verified Doubles for supervisor memory monitoring.

tests/Integration/Horizon/Feature/MonitorSupervisorMemoryTest.php

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

Convert wait-time monitor doubles

• Migrates wait-time 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 collaborators.

tests/Integration/Horizon/Feature/ProcessInspectorTest.php

RedisPayloadTest.phpConvert Redis payload doubles +6/-3

Convert Redis payload doubles

• Uses Double for directly mocked payload dependencies.

tests/Integration/Horizon/Feature/RedisPayloadTest.php

SupervisorTest.phpConvert supervisor feature doubles +8/-5

Convert supervisor feature doubles

• Migrates supervisor collaborators to Double.

tests/Integration/Horizon/Feature/SupervisorTest.php

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

Convert failed-job trimming doubles

• Uses verified Doubles for trimming dependencies.

tests/Integration/Horizon/Feature/TrimFailedJobsTest.php

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

Convert monitored-job trimming doubles

• Migrates trimming expectations to Double.

tests/Integration/Horizon/Feature/TrimMonitoredJobsTest.php

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

Convert recent-job trimming doubles

• Uses verified Doubles for trimming collaborators.

tests/Integration/Horizon/Feature/TrimRecentJobsTest.php

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

Convert wait-time calculator doubles

• Migrates wait-time calculation dependencies to Double.

tests/Integration/Horizon/Feature/WaitTimeCalculatorTest.php

WorkerProcessTest.phpConvert worker process doubles +33/-20

Convert worker process doubles

• Uses verified Doubles for Horizon worker process lifecycle interactions.

tests/Integration/Horizon/Feature/WorkerProcessTest.php

MailFailoverTransportTest.phpConvert failover mail doubles +5/-2

Convert failover mail doubles

• Uses verified Doubles for mail transport dependencies.

tests/Integration/Mail/MailFailoverTransportTest.php

MailLogTransportTest.phpConvert log mail doubles +5/-2

Convert log mail doubles

• Migrates direct transport mocks to Double.

tests/Integration/Mail/MailLogTransportTest.php

MailManagerTest.phpConvert mail manager doubles +10/-7

Convert mail manager doubles

• Uses verified Doubles for manager collaborators.

tests/Integration/Mail/MailManagerTest.php

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

Convert round-robin mail doubles

• Migrates transport expectations to Double.

tests/Integration/Mail/MailRoundRobinTransportTest.php

SendingQueuedMailTest.phpConvert queued mail doubles +8/-5

Convert queued mail doubles

• Uses verified Doubles for queued mail dependencies.

tests/Integration/Mail/SendingQueuedMailTest.php

SigningKeyConcurrencyTest.phpConvert key concurrency doubles +9/-7

Convert key concurrency doubles

• Migrates directly mocked signing-key dependencies to Double.

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

DatabaseQueueReservationTest.phpConvert queue reservation doubles +11/-8

Convert queue reservation doubles

• Uses verified Doubles for SQLite reservation dependencies.

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

WorkerResourceLifetimeTest.phpConvert worker resource doubles +47/-40

Convert worker resource doubles

• Migrates resource lifetime and cleanup expectations to Double.

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

FailOnExceptionMiddlewareTest.phpConvert failure middleware doubles +6/-3

Convert failure middleware doubles

• Uses verified Doubles for exception middleware dependencies.

tests/Integration/Queue/FailOnExceptionMiddlewareTest.php

OutboxClaimTestCase.phpConvert outbox claim fixture +4/-2

Convert outbox claim fixture

• Uses Double in shared outbox claim setup.

tests/Integration/Queue/Fixtures/OutboxClaimTestCase.php

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

Convert Redis rate-limit doubles

• Migrates Redis store collaborators to verified Doubles.

tests/Integration/Queue/Redis/RateLimitedRedisStoreTest.php

ThrottlesExceptionsTest.phpConvert exception throttle doubles +24/-16

Convert exception throttle doubles

• Uses verified Doubles for queue exception-throttling interactions.

tests/Integration/Queue/ThrottlesExceptionsTest.php

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

Convert unique-job doubles

• Replaces direct Mockery setup with Double.

tests/Integration/Queue/UniqueJobTest.php

WithoutOverlappingJobsTest.phpConvert overlap middleware doubles +12/-9

Convert overlap middleware doubles

• Uses verified Doubles for overlapping-job prevention dependencies.

tests/Integration/Queue/WithoutOverlappingJobsTest.php

RouteCachingTest.phpConvert route caching doubles +17/-14

Convert route caching doubles

• Migrates caching test collaborators to verified Doubles.

tests/Integration/Routing/RouteCachingTest.php

DatabaseVectorImportTest.phpConvert vector import doubles +6/-3

Convert vector import doubles

• Uses Double for directly mocked import dependencies.

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

DatabaseSessionHandlerTestCase.php...

@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. Cluster pipelines can fail with a type error 🐞 Bug ≡ Correctness
Description
RedisProxy::pipeline() declares a return type that excludes RedisCluster, although its
no-callback path returns the native client's pipeline result unchanged. When a cluster connection
returns its native pipeline object, the new declaration raises a TypeError before the caller can
use it.
Code

src/redis/src/RedisProxy.php[192]

+    public function pipeline(?callable $callback = null): Redis|array|bool
Evidence
The no-callback helper returns the forwarded command result directly; cluster pools create a
connection backed by RedisCluster, and RedisConnection forwards the command to that native client.
The newly declared pipeline type lacks RedisCluster, unlike the adjacent transaction type.

src/redis/src/RedisProxy.php[187-218]
src/redis/src/RedisProxy.php[265-294]
src/redis/src/RedisConnection.php[398-441]
src/redis/src/Pool/RedisPool.php[67-70]
src/redis/src/PhpRedisClusterConnection.php[40-55]

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 new pipeline return type excludes the native cluster client returned by the no-callback cluster path.
## Fix Focus Areas
- src/redis/src/RedisProxy.php[187-195]
- src/redis/src/RedisProxy.php[208-218]
## Recommended Fix
Include `RedisCluster` in the pipeline return type and update its conditional PHPDoc. Add a no-callback cluster pipeline test that verifies the returned native object.

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



Remediation recommended

2. A flush macro can clear the cache instead 🐞 Bug ≡ Correctness
Description
The new concrete Repository::flush() bypasses Repository::__call(), which previously gave
registered macros precedence over forwarding to the store. An application or package that registered
a flush macro will now invoke clear() instead of its macro when it calls that method.
Code

src/cache/src/Repository.php[R888-891]

+    public function flush(): bool
+    {
+        // Forward through clear() so flush() emits the same events instead of bypassing them via __call().
+        return $this->clear();
Evidence
Before the concrete method existed, flush() entered __call(), whose first branch executes a
registered macro. Macro registration accepts the name flush, while PHP dispatches the new concrete
method without entering __call().

src/cache/src/Repository.php[885-892]
src/cache/src/Repository.php[1434-1441]
src/macroable/src/Traits/Macroable.php[26-35]

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

## Issue description
Adding a concrete flush method bypasses previously supported macro dispatch for the same name.
## Fix Focus Areas
- src/cache/src/Repository.php[885-892]
- src/cache/src/Repository.php[1434-1441]
## Recommended Fix
Have the concrete flush method invoke a registered `flush` macro when present, and otherwise call `clear()` so ordinary flushes retain lifecycle events. Cover both paths with tests.

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


3. Doctor's autoload repair can undo the new production requirement ✓ Resolved
Description
ComposerAutoloadIsValid::fix() regenerates the autoloader with dump-autoload --optimize, which
has no --classmap-authoritative flag and runs in any environment.
ComposerAutoloadIsAuthoritative::check() only reads the loader already in memory. On a production
doctor --fix run, the repair rewrites vendor/composer as non-authoritative, yet the new check
still passes because the running process keeps the old authoritative loader. Workers restarted
afterwards load the non-authoritative map without any warning.

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: 5/5 Tier: plus

[High impact] The PR appears safe to merge; no new actionable issue remains.

Summary

Completes the remaining direct Mockery-to-Double conversions and adds framework corrections.

  • Authorization keeps ordinary data and resolves policy names consistently.
  • Cache flushes use the same event-aware path as cache clears.
  • Production Doctor checks for an authoritative Composer class map.
  • Redis transactions and pipelines keep cleanup behavior on the proxy.
  • The development setup now requires PhpRedis 6.3 or newer.
  • Framework tests use strict and passthrough doubles instead of directly created Mockery mocks.

binaryfire intentionally chose explicit policy mappings for unusual PHP model aliases that depend on alias-specific container settings.

Review checks found no new actionable issue. git diff --check passed. Tests were not run; dependencies are not installed in this checkout.

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

Comment thread src/auth/src/Access/Gate.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. Native RedisCluster does not provide pipeline(), and the cluster connection does not implement it. The existing pipeline return type matches supported native behavior; widening it and adding a mock-only cluster pipeline case would describe unsupported behavior.
  2. flush() is now a declared repository operation, with the same native-method precedence over macros as the rest of the API. Adding macro dispatch inside that one native method would introduce an inconsistent exception. The ordinary flush event fix remains.
  3. Fixed in debc72d: autoload repair preserves the current loader mode, using --classmap-authoritative when already enabled and --optimize otherwise. The displayed repair command matches execution. Tests cover both modes; dev-package selection and the read-only validity probe remain unchanged.

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 6ebb21f into 0.4 Nov 17, 2026
45 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