Skip to content

Use Double across core framework tests - #747

Merged
binaryfire merged 4 commits into
0.4from
tests-double-remaining-2026-11-17
Nov 16, 2026
Merged

binaryfire merged 4 commits into
0.4from
tests-double-remaining-2026-11-17

Conversation

@binaryfire

@binaryfire binaryfire commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Test doubles

Replace direct Mockery doubles with Double across AI, authentication, cache, console, coroutine, Data, database, filesystem, Fortify and Foundation tests, including their supporting packages. Keep existing PHPUnit doubles and framework APIs backed by Mockery.

The conversion preserves required calls, arguments, ordering, forbidden calls and exception behavior. Tests use real objects where mocking adds no value. Redis cache tests exercise real connection forwarding with strict native-client doubles, and scan tests use concrete clients to preserve cursor updates by reference. Duplicate Redis lock coverage is consolidated and an unused query-builder test base is removed.

Supporting changes

  • Resolve the database CLI process through the container with explicit constructor parameters. Tests can replace it without constructor interception or separate PHP processes; launch options and output forwarding stay intact.
  • Add getHints() to ViewFinderInterface, alongside namespace registration. View caching and static analysis can discover namespaced views through the contract without assuming FileViewFinder. Document the requirements for custom finders.
  • Make the exception-renderer isolation test interleave coroutines and tighten tagged-cache tests to reject extra Redis commands or incorrect keys.

Verification

Changed test files and affected fixture consumers pass individually, including Redis cache coverage and analyzer view-discovery/cache-invalidation tests. Existing dependency and serializer-build skips remain unchanged. Full static analysis, root and skeleton formatting, and whitespace checks pass.

View guided diff Turn on auto-fix

Note

Replace Mockery with JMac test doubles across core framework tests

  • Migrates the entire test suite from Mockery mocks to JMac\Testing\Double with the VerifiesDoubles PHPUnit trait, converting return values, argument matchers, callbacks, call counts, and exceptions to the new API across cache, database, auth, console, coroutine, AI, filesystem, and foundation tests.
  • Some tests now use real objects instead of mocks: created Request instances, concrete FlattenException and Data objects, a real Hypervel container, and a real Events Dispatcher in DatabaseIntegrationTest.
  • Strict Redis client doubles in RedisCacheTestCase.php now fail on unconfigured commands instead of returning Mockery defaults, and many Redis expectations moved from the connection to its client. Fake clients (FakeRedisClient, PruneRedisClusterClient) record calls for explicit assertions.
  • Adds getHints(): array to ViewFinderInterface.php; custom view finder implementations must now provide getHints(), prependLocation(), and getPaths().
  • DbCommand::handle now resolves its Symfony Process through the container instead of constructing it directly.
  • Behavioral Change: strict doubles and migration changes tighten several tests — e.g. cluster-mode tests in AddTest/FlushTest no longer fail when pipeline is invoked, testTouchingParent in EloquentBelongsToManyTest.php now expects 09:10:10, and DatabaseDbCommandLaunchTest dropped its separate-process attributes. The VerifiesDoubles trait enforces double verification in every migrated test class.

Macroscope summarized 4d4ad4a.

Replace direct Mockery doubles across AI, API clients, authentication, broadcasting, bus, top-level cache, connection pools and non-scheduler console tests. Keep Mockery-backed framework APIs and existing PHPUnit doubles intact.

Preserve required arguments, object identity, forbidden calls and verification counts with native doubles. Use initialized partials and real containers where appropriate, explicit callback capture, and local operation sequences for cross-double ordering. Declare dynamic Redis and console methods in typed test fixtures without changing production APIs.

Consolidate duplicate Redis lock suites while retaining all distinct acquisition, ownership, callback and cleanup coverage. Verify ApiResource's unknown-method behavior against the real response rather than a mocking-library exception. Strengthen the untouched-parent timestamp assertion and correct the Redis integration comment.

Validation: every changed test class and fixture consumer passed individually, including coroutine, cleanup and cancellation cases. Existing serializer-build skips remain. Root, type-fixture and skeleton static analysis passed; repository and skeleton formatting completed; git diff --check passed.
Replace direct Mockery doubles in the Redis cache suite, remaining scheduler
cases, Context, Cookie, Coordinator, Core, Coroutine, Data and the first
Database test group. Preserve explicit call counts, forbidden calls, argument
checks, cancellation ownership and cross-call ordering.

Exercise Redis operations through initialized connections and strict native
client doubles. Reuse concrete scan fixtures where cursor arguments must be
updated by reference, retaining pagination and concurrent membership-repair
coverage. Record scan inputs and metadata operations for existing assertions;
remove one duplicate page test and an unreachable native null-scan case.

Use real request, DTO and dispatcher objects where mocking adds no value.
Keep scheduler default stubs from absorbing forbidden or excess calls.
Resolve the database CLI Process through the existing container with explicit
parameters, retaining fresh process ownership, launch options and streamed
output while removing constructor interception and isolated test processes.

Validation: every changed test file passed independently. The affected Redis
cache group passed 491 tests with 2803 assertions. Source, type-fixture and
skeleton static analysis passed, as did root/skeleton formatting and the
final changed-file formatting and whitespace checks.
Replace remaining direct Mockery doubles across database lifecycle tests,
DI, Doctor, Encryption, Engine, Filesystem, Fortify and Foundation. Preserve
call counts, argument checks, ordering, exception identity and the existing
framework APIs that still use Mockery internally.

Use real configuration and exception objects where no double is needed.
Exercise Flysystem forwarding through real adapters, keep stream reads in
call resolvers, and record database trait ordering in its existing fixture.
Make the renderer isolation test actually interleave its coroutines, remove
redundant framework cleanup, and delete an unused query-builder test base.

Complete ViewFinderInterface with getHints(), alongside its existing
namespace-registration methods. Remove concrete-finder assumptions from
view caching and analyzer discovery, cover namespaced roots in the command
test, and document the contract requirements for custom implementations.

Tighten tagged-cache flush tests to reject extra native Redis commands and
incorrect keys while preserving the two checks needed for racing writers.

Validation: each changed test file passed, including the existing analyzer
namespace-discovery and cache-invalidation tests. The existing GCS skip is
unchanged. Full static analysis, formatting and whitespace checks passed.
@coderabbitai

coderabbitai Bot commented Nov 16, 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

@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

Deploying hypervel-org with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4d4ad4a
Status:🚫  Build failed.

View logs

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

Copy link
Copy Markdown

PR Summary by Qodo

Use Double across remaining framework tests

🧪 Tests ✨ Enhancement 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Replace direct Mockery test doubles with Double across core framework and supporting package
 tests.
• Exercise Redis forwarding with strict client doubles and concrete scan clients; consolidate
 duplicate lock coverage.
• Make database CLI processes replaceable and expose namespace hints through the view finder
 contract.
Diagram

graph TD
  Tests["Framework tests"] --> Double["Double expectations"] --> Connection["Redis forwarding"] --> Client["Native client"]
  Finder["View finder contract"] --> Consumers["View consumers"]
  Command["Database CLI command"] --> Container["Container process"]
Loading
High-Level Assessment

Keep the targeted conversion: it preserves existing PHPUnit and Mockery-backed framework APIs while making expectations explicit. Real Redis forwarding and concrete scan fakes address behavior that substituting every layer would miss; container resolution removes the need for process class overloading.

Files changed (268) +8552 / -8214

Enhancement (4) +15 / -15
DbCommand.phpResolve the CLI process through the container +5/-5

Resolve the CLI process through the container

• Passes the command and environment as explicit resolution parameters while retaining timeout, TTY, and output handling.

src/database/src/Console/DbCommand.php

RuntimeInputs.phpInclude contract-provided view hints in cache keys +2/-5

Include contract-provided view hints in cache keys

• Reads namespace directories from any view finder when determining view cache invalidation.

src/phpstan/src/Support/RuntimeInputs.php

ViewFileHelper.phpDiscover hints from custom view finders +1/-5

Discover hints from custom view finders

• Collects namespace directories through the finder contract rather than a concrete-class check.

src/phpstan/src/Support/ViewFileHelper.php

ViewFinderInterface.phpAdd namespace-hint discovery to finder contract +7/-0

Add namespace-hint discovery to finder contract

• Declares getHints() so view caching and analysis can discover namespaced view paths.

src/view/src/ViewFinderInterface.php

Refactor (1) +0 / -2
ViewCacheCommand.phpRemove concrete finder assumption +0/-2

Remove concrete finder assumption

• Uses the view finder's existing contract instead of annotating it as a FileViewFinder.

src/foundation/src/Console/ViewCacheCommand.php

Tests (260) +8533 / -8196
BroadcastBatchingTest.phpConvert broadcast batching collaborator doubles +6/-3

Convert broadcast batching collaborator doubles

• Uses Double to verify batching interactions.

tests/Ai/BroadcastBatchingTest.php

ConcurrentToolsTest.phpConvert concurrent tool collaborator doubles +34/-31

Convert concurrent tool collaborator doubles

• Preserves tool-call expectations in concurrent execution tests.

tests/Ai/ConcurrentToolsTest.php

CoroutineIsolationTest.phpConvert AI coroutine isolation doubles +25/-22

Convert AI coroutine isolation doubles

• Retains isolation assertions with verified Double collaborators.

tests/Ai/CoroutineIsolationTest.php

AgentEventsTest.phpConvert agent event doubles +9/-7

Convert agent event doubles

• Verifies agent event interactions using Double.

tests/Ai/Feature/AgentEventsTest.php

AgentProviderSelectionTest.phpConvert provider-selection doubles +31/-24

Convert provider-selection doubles

• Retains provider-selection expectations without direct Mockery doubles.

tests/Ai/Feature/AgentProviderSelectionTest.php

AiManagerTest.phpConvert AI manager doubles +5/-2

Convert AI manager doubles

• Uses Double for manager collaborator expectations.

tests/Ai/Feature/AiManagerTest.php

BroadcastAgentTest.phpConvert broadcast agent doubles +8/-5

Convert broadcast agent doubles

• Verifies agent broadcasting with Double.

tests/Ai/Feature/BroadcastAgentTest.php

EmbeddingsCacheTest.phpConvert embeddings cache doubles +15/-12

Convert embeddings cache doubles

• Preserves cache interaction assertions using Double.

tests/Ai/Feature/EmbeddingsCacheTest.php

FilesystemToolsTest.phpConvert filesystem tool doubles +27/-23

Convert filesystem tool doubles

• Checks filesystem tool calls and arguments with Double.

tests/Ai/Feature/FilesystemToolsTest.php

CreatesClientTest.phpConvert gateway client-construction doubles +10/-7

Convert gateway client-construction doubles

• Verifies client creation through Double expectations.

tests/Ai/Feature/Gateway/Concerns/CreatesClientTest.php

PendingProviderTest.phpConvert pending-provider doubles +25/-16

Convert pending-provider doubles

• Retains provider configuration and invocation checks.

tests/Ai/Feature/PendingProviderTest.php

RememberConversationTest.phpConvert conversation-memory doubles +52/-60

Convert conversation-memory doubles

• Preserves conversation storage and retrieval assertions with Double.

tests/Ai/Feature/RememberConversationTest.php

DatabaseConversationStoreTest.phpConvert database conversation-store doubles +25/-23

Convert database conversation-store doubles

• Verifies database-backed conversation operations through Double.

tests/Ai/Feature/Storage/DatabaseConversationStoreTest.php

StoreFakeTest.phpConvert store-fake collaborator doubles +11/-7

Convert store-fake collaborator doubles

• Retains fake-store behavior assertions.

tests/Ai/Feature/StoreFakeTest.php

StreamEventBroadcastTest.phpConvert stream broadcast doubles +6/-3

Convert stream broadcast doubles

• Checks stream event broadcasting with Double.

tests/Ai/Feature/StreamEventBroadcastTest.php

ToolRequestValidationTest.phpConvert tool validation doubles +6/-3

Convert tool validation doubles

• Preserves tool-request validation expectations.

tests/Ai/Feature/ToolRequestValidationTest.php

ApprovableNamedTool.phpAdd approvable named-tool fixture +11/-0

Add approvable named-tool fixture

• Provides a typed approvable tool for Double-backed AI tests.

tests/Ai/Fixtures/Tools/ApprovableNamedTool.php

McpClientTransportTest.phpConvert MCP transport doubles +8/-5

Convert MCP transport doubles

• Verifies transport interactions through Double.

tests/Ai/McpClientTransportTest.php

PartitionStoreTest.phpConvert partition-store doubles +4/-2

Convert partition-store doubles

• Preserves partition storage checks with Double.

tests/Ai/PartitionStoreTest.php

InvokesToolsTest.phpConvert tool-invocation doubles +6/-3

Convert tool-invocation doubles

• Verifies gateway tool invocation through Double.

tests/Ai/Unit/Gateway/InvokesToolsTest.php

AudioFilenameTest.phpSimplify audio filename test doubles +2/-3

Simplify audio filename test doubles

• Replaces unnecessary mocking in filename coverage.

tests/Ai/Unit/Gateway/OpenAi/AudioFilenameTest.php

RunContextTest.phpConvert run-context doubles +6/-3

Convert run-context doubles

• Retains gateway context assertions using Double.

tests/Ai/Unit/Gateway/RunContextTest.php

TextGenerationLoopTest.phpConvert text-generation loop doubles +59/-53

Convert text-generation loop doubles

• Preserves generation-loop calls, responses, and sequencing.

tests/Ai/Unit/Gateway/TextGenerationLoopTest.php

AgentToolTest.phpConvert agent-tool doubles +18/-15

Convert agent-tool doubles

• Verifies tool behavior with typed Double collaborators.

tests/Ai/Unit/Tools/AgentToolTest.php

ApiRequestTest.phpConvert API request doubles +6/-3

Convert API request doubles

• Retains request interaction assertions through Double.

tests/ApiClient/ApiRequestTest.php

ApiResourceTest.phpConvert API resource doubles +36/-39

Convert API resource doubles

• Uses Double for collaborators and tests unknown methods against a real response.

tests/ApiClient/ApiResourceTest.php

AuthAccessGateTest.phpConvert access-gate doubles +12/-9

Convert access-gate doubles

• Preserves authorization interaction checks using Double.

tests/Auth/AuthAccessGateTest.php

AuthDatabaseTokenRepositoryTest.phpConvert database token-repository doubles +26/-22

Convert database token-repository doubles

• Retains token persistence expectations.

tests/Auth/AuthDatabaseTokenRepositoryTest.php

AuthEloquentUserProviderCacheTest.phpConvert cached user-provider doubles +162/-167

Convert cached user-provider doubles

• Preserves cache and provider calls and their arguments.

tests/Auth/AuthEloquentUserProviderCacheTest.php

AuthManagerTest.phpConvert auth manager doubles +92/-93

Convert auth manager doubles

• Retains guard and provider resolution assertions.

tests/Auth/AuthManagerTest.php

AuthPasswordResetServiceProviderTest.phpConvert password-reset provider doubles +25/-28

Convert password-reset provider doubles

• Verifies service registration using Double.

tests/Auth/AuthPasswordResetServiceProviderTest.php

AuthRequestGuardTest.phpConvert request-guard doubles +20/-17

Convert request-guard doubles

• Preserves request authentication expectations.

tests/Auth/AuthRequestGuardTest.php

AuthServiceProviderTest.phpConvert auth service-provider doubles +106/-156

Convert auth service-provider doubles

• Uses captured callbacks and verified Double dependencies for provider registration.

tests/Auth/AuthServiceProviderTest.php

AuthenticateWithBasicAuthMiddlewareTest.phpConvert basic-auth middleware doubles +19/-15

Convert basic-auth middleware doubles

• Retains authentication and response assertions.

tests/Auth/AuthenticateWithBasicAuthMiddlewareTest.php

AuthorizableTest.phpConvert authorizable doubles +28/-24

Convert authorizable doubles

• Verifies authorization delegation through Double.

tests/Auth/AuthorizableTest.php

AuthorizesRequestsTest.phpConvert request-authorization doubles +26/-22

Convert request-authorization doubles

• Preserves authorization call assertions.

tests/Auth/AuthorizesRequestsTest.php

CacheTokenRepositoryTest.phpConvert cache token-repository doubles +57/-53

Convert cache token-repository doubles

• Checks token-cache calls and arguments with Double.

tests/Auth/CacheTokenRepositoryTest.php

ClearResetsCommandTest.phpConvert reset-clearing command doubles +16/-13

Convert reset-clearing command doubles

• Verifies password-reset cleanup interactions.

tests/Auth/ClearResetsCommandTest.php

EnsureEmailIsVerifiedTest.phpConvert email-verification middleware doubles +25/-24

Convert email-verification middleware doubles

• Retains verification and redirect assertions.

tests/Auth/EnsureEmailIsVerifiedTest.php

RedirectIfAuthenticatedMiddlewareTest.phpConvert authenticated-redirect doubles +27/-24

Convert authenticated-redirect doubles

• Preserves guard checks and redirect behavior.

tests/Auth/RedirectIfAuthenticatedMiddlewareTest.php

RequirePasswordMiddlewareTest.phpConvert password-confirmation middleware doubles +56/-58

Convert password-confirmation middleware doubles

• Retains password confirmation and redirect expectations.

tests/Auth/RequirePasswordMiddlewareTest.php

TimeboxIsolationTest.phpConvert timebox isolation doubles +23/-19

Convert timebox isolation doubles

• Preserves coroutine-local timing assertions.

tests/Auth/TimeboxIsolationTest.php

UseGuardMiddlewareTest.phpConvert guard-selection doubles +7/-4

Convert guard-selection doubles

• Verifies middleware guard switching.

tests/Auth/UseGuardMiddlewareTest.php

VerifiedEventTest.phpConvert verified-event doubles +5/-2

Convert verified-event doubles

• Retains verification event assertions.

tests/Auth/VerifiedEventTest.php

BroadcastConnectionReleaseTest.phpConvert connection-release doubles +19/-14

Convert connection-release doubles

• Verifies broadcast connection cleanup.

tests/Broadcasting/BroadcastConnectionReleaseTest.php

BroadcastPoolProxyTest.phpConvert broadcast pool-proxy doubles +7/-4

Convert broadcast pool-proxy doubles

• Preserves proxy forwarding assertions.

tests/Broadcasting/BroadcastPoolProxyTest.php

InteractsWithBroadcastingTest.phpConvert broadcasting trait doubles +8/-5

Convert broadcasting trait doubles

• Checks trait broadcast interactions through Double.

tests/Broadcasting/InteractsWithBroadcastingTest.php

LogBroadcasterTest.phpConvert log broadcaster doubles +10/-7

Convert log broadcaster doubles

• Verifies logged broadcast behavior.

tests/Broadcasting/LogBroadcasterTest.php

PendingBroadcastTest.phpConvert pending broadcast doubles +14/-11

Convert pending broadcast doubles

• Preserves dispatch interaction assertions.

tests/Broadcasting/PendingBroadcastTest.php

BusDebounceLockTest.phpConvert debounce-lock doubles +16/-12

Convert debounce-lock doubles

• Retains locking and dispatch expectations.

tests/Bus/BusDebounceLockTest.php

DispatchLockContextTest.phpConvert dispatch-lock context doubles +19/-16

Convert dispatch-lock context doubles

• Verifies context-sensitive lock interactions.

tests/Bus/DispatchLockContextTest.php

OutboxOptionsTest.phpConvert outbox options doubles +7/-3

Convert outbox options doubles

• Preserves option forwarding checks.

tests/Bus/OutboxOptionsTest.php

QueueableTest.phpConvert queueable doubles +11/-7

Convert queueable doubles

• Retains queued-job interaction assertions.

tests/Bus/QueueableTest.php

CacheDatabaseLockTest.phpConvert database-lock doubles +124/-120

Convert database-lock doubles

• Preserves acquisition, ownership, and release checks.

tests/Cache/CacheDatabaseLockTest.php

CacheMemoizedStoreTest.phpConvert memoized-store doubles +18/-15

Convert memoized-store doubles

• Verifies backing-store calls through Double.

tests/Cache/CacheMemoizedStoreTest.php

CacheNullStoreTest.phpConvert null-store doubles +7/-4

Convert null-store doubles

• Retains null-store interaction assertions.

tests/Cache/CacheNullStoreTest.php

CacheRedisLockTest.phpConsolidate and convert Redis lock coverage +222/-81

Consolidate and convert Redis lock coverage

• Combines distinct lock cases in one Double-backed suite, retaining acquisition, ownership, callbacks, and cleanup coverage.

tests/Cache/CacheRedisLockTest.php

CacheRepositoryEnumTest.phpConvert repository enum doubles +51/-47

Convert repository enum doubles

• Preserves enum-cache behavior assertions.

tests/Cache/CacheRepositoryEnumTest.php

CacheServiceProviderTest.phpConvert cache service-provider doubles +36/-45

Convert cache service-provider doubles

• Verifies cache registration and resolution.

tests/Cache/CacheServiceProviderTest.php

CacheStackStoreLocksTest.phpConvert stack-store lock doubles +28/-21

Convert stack-store lock doubles

• Checks lock delegation and arguments.

tests/Cache/CacheStackStoreLocksTest.php

CacheStackStoreTagsTest.phpConvert stack-store tag doubles +193/-166

Convert stack-store tag doubles

• Preserves tagged-store delegation and key assertions.

tests/Cache/CacheStackStoreTagsTest.php

CacheStackStoreTest.phpConvert stack-store doubles +364/-276

Convert stack-store doubles

• Retains store selection, forwarding, and failure coverage.

tests/Cache/CacheStackStoreTest.php

CacheSwooleStoreConcurrencyTest.phpSimplify Swoole concurrency fixtures +2/-3

Simplify Swoole concurrency fixtures

• Removes unnecessary mocking from concurrency coverage.

tests/Cache/CacheSwooleStoreConcurrencyTest.php

CacheSwooleStoreIntervalTest.phpConvert Swoole interval doubles +16/-13

Convert Swoole interval doubles

• Verifies interval-driven cache behavior.

tests/Cache/CacheSwooleStoreIntervalTest.php

CacheSwooleStoreTest.phpConvert Swoole store doubles +18/-17

Convert Swoole store doubles

• Preserves store operations and collaborator checks.

tests/Cache/CacheSwooleStoreTest.php

CacheTaggedCacheTest.phpConvert tagged-cache doubles +43/-46

Convert tagged-cache doubles

• Tightens tagged-cache call and key expectations.

tests/Cache/CacheTaggedCacheTest.php

ConcurrencyLimiterTest.phpConvert concurrency-limiter doubles +7/-4

Convert concurrency-limiter doubles

• Retains limit and lock assertions.

tests/Cache/ConcurrencyLimiterTest.php

ForgetCommandTest.phpConvert cache-forget command doubles +12/-9

Convert cache-forget command doubles

• Verifies command cache operations.

tests/Cache/ForgetCommandTest.php

ModelCacheCoordinatorTest.phpConvert model-cache coordinator doubles +111/-107

Convert model-cache coordinator doubles

• Preserves model cache invalidation and coordination checks.

tests/Cache/ModelCacheCoordinatorTest.php

ModelCacheStoreValidatorTest.phpConvert model-cache validator doubles +19/-16

Convert model-cache validator doubles

• Retains store validation expectations.

tests/Cache/ModelCacheStoreValidatorTest.php

PruneStaleTagsCommandTest.phpConvert stale-tag pruning command doubles +29/-34

Convert stale-tag pruning command doubles

• Verifies pruning calls and command results.

tests/Cache/PruneStaleTagsCommandTest.php

AllTagSetTest.phpConvert all-tag set doubles +30/-40

Convert all-tag set doubles

• Checks Redis tag-set commands with explicit client expectations.

tests/Cache/Redis/AllTagSetTest.php

AllTaggedCacheTest.phpConvert all-tag cache doubles +306/-342

Convert all-tag cache doubles

• Preserves all-tag cache behavior through real connection forwarding.

tests/Cache/Redis/AllTaggedCacheTest.php

AnyTagSetTest.phpConvert any-tag set doubles +51/-71

Convert any-tag set doubles

• Checks tag-set Redis commands and keys.

tests/Cache/Redis/AnyTagSetTest.php

AnyTaggedCacheTest.phpConvert any-tag cache doubles +243/-283

Convert any-tag cache doubles

• Preserves any-tag operations with strict native-client expectations.

tests/Cache/Redis/AnyTaggedCacheTest.php

BenchmarkCommandTest.phpConvert Redis benchmark command doubles +42/-36

Convert Redis benchmark command doubles

• Verifies benchmark command collaborators.

tests/Cache/Redis/Console/BenchmarkCommandTest.php

CleanupVerificationCheckTest.phpConvert cleanup diagnostic doubles +8/-5

Convert cleanup diagnostic doubles

• Retains Redis cleanup verification checks.

tests/Cache/Redis/Console/Doctor/Checks/CleanupVerificationCheckTest.php

DoctorCommandTest.phpConvert Redis doctor command doubles +189/-199

Convert Redis doctor command doubles

• Preserves diagnostic checks and command output assertions.

tests/Cache/Redis/Console/DoctorCommandTest.php

ExceptionPropagationTest.phpConvert Redis exception doubles +33/-24

Convert Redis exception doubles

• Checks exception propagation through connection forwarding.

tests/Cache/Redis/ExceptionPropagationTest.php

AddTest.phpConvert Redis add-operation doubles +11/-16

Convert Redis add-operation doubles

• Verifies add commands and arguments against native clients.

tests/Cache/Redis/Operations/AddTest.php

AddEntryTest.phpConvert all-tag entry-add doubles +69/-98

Convert all-tag entry-add doubles

• Retains entry registration and Redis command checks.

tests/Cache/Redis/Operations/AllTag/AddEntryTest.php

AddTest.phpConvert all-tag add doubles +28/-35

Convert all-tag add doubles

• Verifies all-tag add commands.

tests/Cache/Redis/Operations/AllTag/AddTest.php

DecrementTest.phpConvert all-tag decrement doubles +41/-57

Convert all-tag decrement doubles

• Preserves decrement and tag bookkeeping checks.

tests/Cache/Redis/Operations/AllTag/DecrementTest.php

FlushStaleTest.phpConvert stale all-tag flush doubles +48/-63

Convert stale all-tag flush doubles

• Retains stale-entry cleanup expectations.

tests/Cache/Redis/Operations/AllTag/FlushStaleTest.php

FlushTest.phpConvert all-tag flush doubles +114/-135

Convert all-tag flush doubles

• Checks Redis cleanup calls and tag keys.

tests/Cache/Redis/Operations/AllTag/FlushTest.php

ForeverTest.phpConvert all-tag forever doubles +59/-79

Convert all-tag forever doubles

• Verifies persistent tagged entries.

tests/Cache/Redis/Operations/AllTag/ForeverTest.php

GetEntriesTest.phpUse a concrete client for entry scans +97/-170

Use a concrete client for entry scans

• Preserves by-reference scan cursors and asserts scan calls and collected entries.

tests/Cache/Redis/Operations/AllTag/GetEntriesTest.php

IncrementTest.phpConvert all-tag increment doubles +41/-57

Convert all-tag increment doubles

• Preserves increment and tag bookkeeping checks.

tests/Cache/Redis/Operations/AllTag/IncrementTest.php

PruneTest.phpConvert all-tag pruning doubles +131/-86

Convert all-tag pruning doubles

• Checks pruning commands, keys, and scan results.

tests/Cache/Redis/Operations/AllTag/PruneTest.php

PutManyTest.phpConvert all-tag bulk-write doubles +121/-163

Convert all-tag bulk-write doubles

• Preserves batch write and tag indexing expectations.

tests/Cache/Redis/Operations/AllTag/PutManyTest.php

PutTest.phpConvert all-tag write doubles +73/-96

Convert all-tag write doubles

• Verifies writes and tag bookkeeping.

tests/Cache/Redis/Operations/AllTag/PutTest.php

TouchTest.phpConvert all-tag touch doubles +13/-16

Convert all-tag touch doubles

• Checks tagged-entry expiration updates.

tests/Cache/Redis/Operations/AllTag/TouchTest.php

AddTest.phpConvert any-tag add doubles +36/-44

Convert any-tag add doubles

• Verifies add and tag registry commands.

tests/Cache/Redis/Operations/AnyTag/AddTest.php

DecrementTest.phpConvert any-tag decrement doubles +37/-37

Convert any-tag decrement doubles

• Preserves decrement and tag updates.

tests/Cache/Redis/Operations/AnyTag/DecrementTest.php

FlushTest.phpConvert any-tag flush doubles +129/-96

Convert any-tag flush doubles

• Retains tag cleanup and key checks.

tests/Cache/Redis/Operations/AnyTag/FlushTest.php

ForeverTest.phpConvert any-tag forever doubles +5/-5

Convert any-tag forever doubles

• Checks persistent tagged writes.

tests/Cache/Redis/Operations/AnyTag/ForeverTest.php

GetTagItemsTest.phpConvert tag-item retrieval doubles +24/-36

Convert tag-item retrieval doubles

• Preserves item lookup and Redis command checks.

tests/Cache/Redis/Operations/AnyTag/GetTagItemsTest.php

GetTaggedKeysTest.phpConvert tagged-key retrieval doubles +23/-35

Convert tagged-key retrieval doubles

• Checks Redis key retrieval and arguments.

tests/Cache/Redis/Operations/AnyTag/GetTaggedKeysTest.php

IncrementTest.phpConvert any-tag increment doubles +37/-37

Convert any-tag increment doubles

• Preserves increment and tag updates.

tests/Cache/Redis/Operations/AnyTag/IncrementTest.php

PruneTest.phpUse concrete clients for any-tag pruning scans +229/-153

Use concrete clients for any-tag pruning scans

• Preserves by-reference cursors and checks bounded pruning, keys, and Redis operations.

tests/Cache/Redis/Operations/AnyTag/PruneTest.php

PutManyTest.phpConvert any-tag bulk-write doubles +40/-43

Convert any-tag bulk-write doubles

• Verifies bulk writes and tag metadata.

tests/Cache/Redis/Operations/AnyTag/PutManyTest.php

PutTest.phpConvert any-tag write doubles +37/-41

Convert any-tag write doubles

• Verifies writes and tag registration.

tests/Cache/Redis/Operations/AnyTag/PutTest.php

DecrementTest.phpConvert Redis decrement doubles +3/-3

Convert Redis decrement doubles

• Checks decrement command forwarding.

tests/Cache/Redis/Operations/DecrementTest.php

FlushTest.phpConvert Redis flush doubles +8/-8

Convert Redis flush doubles

• Checks flush command forwarding.

tests/Cache/Redis/Operations/FlushTest.php

ForeverTest.phpConvert Redis forever doubles +4/-6

Convert Redis forever doubles

• Verifies persistent cache writes.

tests/Cache/Redis/Operations/ForeverTest.php

ForgetTest.phpConvert Redis forget doubles +2/-2

Convert Redis forget doubles

• Checks deletion command forwarding.

tests/Cache/Redis/Operations/ForgetTest.php

GetTest.phpConvert Redis get doubles +8/-8

Convert Redis get doubles

• Checks reads through the Redis connection.

tests/Cache/Redis/Operations/GetTest.php

IncrementTest.phpConvert Redis increment doubles +4/-4

Convert Redis increment doubles

• Verifies increment command forwarding.

tests/Cache/Redis/Operations/IncrementTest.php

ManyTest.phpConvert Redis multi-get doubles +4/-6

Convert Redis multi-get doubles

• Verifies bulk-read commands.

tests/Cache/Redis/Operations/ManyTest.php

PutManyTest.phpConvert Redis bulk-write doubles +17/-19

Convert Redis bulk-write doubles

• Preserves write arguments and pipelining checks.

tests/Cache/Redis/Operations/PutManyTest.php

PutTest.phpConvert Redis write doubles +8/-12

Convert Redis write doubles

• Checks write commands and expiration arguments.

tests/Cache/Redis/Operations/PutTest.php

RedisCacheTestCase.phpExercise Redis cache through real connection forwarding +51/-192

Exercise Redis cache through real connection forwarding

• Replaces broad connection mocks with passthrough connection doubles and strict native-client doubles.

tests/Cache/Redis/RedisCacheTestCase.php

RedisStoreTest.phpConvert Redis store doubles +48/-54

Convert Redis store doubles

• Checks store commands through the revised connection fixtures.

tests/Cache/Redis/RedisStoreTest.php

SerializationTest.phpConvert Redis serialization doubles +28/-29

Convert Redis serialization doubles

• Retains serialization and client-option expectations.

tests/Cache/Redis/Support/SerializationTest.php

StoreContextTest.phpConvert Redis store-context doubles +37/-30

Convert Redis store-context doubles

• Preserves context and connection forwarding checks.

tests/Cache/Redis/Support/StoreContextTest.php

RegisterSwooleMaintenanceTimersTest.phpConvert maintenance-timer doubles +44/-35

Convert maintenance-timer doubles

• Verifies Swoole timer registration and callbacks.

tests/Cache/RegisterSwooleMaintenanceTimersTest.php

ConnectionPoolTest.phpConvert connection-pool doubles +27/-26

Convert connection-pool doubles

• Preserves pool lifecycle and connection expectations.

tests/ConnectionPool/ConnectionPoolTest.php

ConnectionTest.phpConvert connection lifecycle doubles +146/-151

Convert connection lifecycle doubles

• Retains connection release, failure, and usage checks.

tests/ConnectionPool/ConnectionTest.php

FooPool.phpUse Double in pool fixture +2/-2

Use Double in pool fixture

• Creates a Double-backed connection for pool tests.

tests/ConnectionPool/Fixtures/FooPool.php

IdleConnectionMonitorTest.phpConvert idle monitor doubles +51/-29

Convert idle monitor doubles

• Preserves idle detection and cleanup assertions.

tests/ConnectionPool/IdleConnectionMonitorTest.php

KeepaliveConnectionTest.phpConvert keepalive connection doubles +24/-24

Convert keepalive connection doubles

• Verifies keepalive and lifecycle calls.

tests/ConnectionPool/KeepaliveConnectionTest.php

InteractsWithIOTest.phpConvert console IO doubles +12/-10

Convert console IO doubles

• Retains prompt and output expectations.

tests/Console/Concerns/InteractsWithIOTest.php

ConfiguresPromptsTest.phpConvert prompt configuration doubles +43/-38

Convert prompt configuration doubles

• Verifies configured prompt behavior using Double.

tests/Console/ConfiguresPromptsTest.php

ConsoleApplicationDeferredCallbacksTest.phpConvert deferred console callback doubles +7/-4

Convert deferred console callback doubles

• Retains deferred execution checks.

tests/Console/ConsoleApplicationDeferredCallbacksTest.php

EventsTest.phpConvert console event doubles +13/-10

Convert console event doubles

• Checks console event dispatch interactions.

tests/Console/Events/EventsTest.php

FooExceptionCommand.phpConvert exception-command fixture +4/-4

Convert exception-command fixture

• Uses Double-backed fixture dependencies while preserving exception behavior.

tests/Console/Fixtures/Commands/FooExceptionCommand.php

FooExitCommand.phpConvert exit-command fixture +4/-4

Convert exit-command fixture

• Uses Double-backed fixture dependencies while preserving exit behavior.

tests/Console/Fixtures/Commands/FooExitCommand.php

ComponentsFactory.phpDeclare dynamic console component methods +42/-0

Declare dynamic console component methods

• Adds a typed test fixture so Double can verify dynamically dispatched prompts and output calls.

tests/Console/Fixtures/ComponentsFactory.php

GeneratorCommandTest.phpConvert generator command doubles +36/-33

Convert generator command doubles

• Preserves generated-file and command interaction checks.

tests/Console/GeneratorCommandTest.php

InteractsWithSignalsTest.phpConvert signal-handler doubles +17/-13

Convert signal-handler doubles

• Verifies console signal registration and handling.

tests/Console/InteractsWithSignalsTest.php

MigrationGeneratorCommandTest.phpConvert migration generator doubles +6/-3

Convert migration generator doubles

• Checks generation interactions with Double.

tests/Console/MigrationGeneratorCommandTest.php

CallbackEventTest.phpConvert callback-event doubles +10/-7

Convert callback-event doubles

• Retains scheduled callback expectations.

tests/Console/Scheduling/CallbackEventTest.php

ScheduleRunCommandTest.phpConvert scheduler command doubles +201/-206

Convert scheduler command doubles

• Preserves mutex, event, failure, and deferred-callback behavior.

tests/Console/Scheduling/ScheduleRunCommandTest.php

ScheduleRunContextPropagationTest.phpConvert scheduler context doubles +21/-19

Convert scheduler context doubles

• Retains task context propagation checks.

tests/Console/Scheduling/ScheduleRunContextPropagationTest.php

ComponentsTest.phpConvert console component doubles +8/-6

Convert console component doubles

• Verifies rendered component interactions.

tests/Console/View/ComponentsTest.php

ContextCoroutineTest.phpSimplify coroutine context fixtures +1/-2

Simplify coroutine context fixtures

• Removes unnecessary mocking from context isolation coverage.

tests/Context/ContextCoroutineTest.php

ContextTest.phpSimplify context fixtures +2/-3

Simplify context fixtures

• Uses a real object where a mock is unnecessary.

tests/Context/ContextTest.php

CookieJarTest.phpConvert cookie-jar doubles +13/-22

Convert cookie-jar doubles

• Retains queued-cookie behavior and argument checks.

tests/Cookie/CookieJarTest.php

AddQueuedCookiesToResponseTest.phpConvert queued-cookie middleware doubles +6/-3

Convert queued-cookie middleware doubles

• Verifies cookies added to responses.

tests/Cookie/Middleware/AddQueuedCookiesToResponseTest.php

TimerTest.phpConvert coordinator timer doubles +11/-9

Convert coordinator timer doubles

• Retains timer scheduling and callback checks.

tests/Coordinator/TimerTest.php

LifecycleCallbackTest.phpConvert lifecycle callback doubles +13/-9

Convert lifecycle callback doubles

• Preserves lifecycle invocation expectations.

<a href='https://github.com/hypervel/components/pull/747/files#diff-cb6ccb3b47a4e2c0...

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

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Custom view finders prevent apps from loading 🐞 Bug ≡ Correctness
Description
ViewFinderInterface now requires getHints(), so an existing custom implementation of the
previous interface is no longer a valid PHP class. An application using such a finder through
Factory::setFinder() fails when that class loads, before it can render views or run view analysis.
Code

src/view/src/ViewFinderInterface.php[72]

+    public function getHints(): array;
Evidence
The added declaration is mandatory for every implementation, while the view factory accepts custom
implementations through the existing interface. The accompanying porting documentation explicitly
acknowledges custom implementations, so this is a supported extension point affected by the change.

src/view/src/ViewFinderInterface.php[63-73]
src/view/src/Factory.php[591-594]
src/docs/porting-from-laravel.md[183-185]

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 `getHints()` to the existing finder interface prevents applications with previously valid custom implementations from loading.
## Fix Focus Areas
- src/view/src/ViewFinderInterface.php[67-72]
- src/phpstan/src/Support/RuntimeInputs.php[321-325]
- src/phpstan/src/Support/ViewFileHelper.php[73-76]
## Recommended Fix
Keep the existing interface compatible. Introduce an optional interface for finders that expose namespace hints, and read hints through that interface in the analysis callers; retain a no-hints fallback for other finders.

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


Grey Divider

Tip of the day
💡 Did you know, you can choose which labels appear on a finding, and whether they show icons or text

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; the previous pruning-test finding is fixed and no new actionable issues were found.

Summary

Replaces direct Mockery doubles with Double across core framework tests.

  • Framework tests use explicit doubles and real objects to check their collaborators.
  • Redis cache tests check commands through the connection and its native client.
  • View caching and analysis tools read namespace hints through the view-finder contract.
  • The database command creates its process through the application container.

Reviews (2) · Last reviewed commit: "Preserve cache tests against unexpected ..." · Reviewed by Greptile

$table->shouldReceive('useWritePdo')->andReturnSelf()->byDefault();
$resolver = Double::for(ConnectionResolverInterface::class);
$connection = Double::for(Connection::class);
$table = Double::for(Builder::class);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Disabled pruning loses its guard

The shared query builder is now lenient. testLockCanBeAcquiredWithoutAutomaticPruning only expects insertOrIgnore, so unexpected where(...)->delete() calls can now succeed silently. The old Mockery double rejected those calls. This loses the test’s guard against deleting lock rows when pruning is disabled.

Make this builder strict, or explicitly forbid pruning calls in that test.

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: the query builder is strict in the disabled-pruning test, so unexpected pruning calls fail. The affected tests pass.

Make the disabled-pruning query builder and stack cache layer doubles strict so unconfigured reads, writes and deletions fail as they did before the Double conversion. Apply the same protection to tagged cache layers while retaining explicit negative assertions and real-store compensation coverage.

All three affected test files pass. Full formatting and the final targeted formatting check pass. No production behavior or dependency requirements change.
@binaryfire

Copy link
Copy Markdown
Member Author

Regarding the custom view finder finding: getHints() is an intentional contract addition for Hypervel 0.4. The finder contract already supports adding, prepending and replacing namespace hints; consumers need to retrieve those hints without depending on FileViewFinder. Custom implementations must implement getHints(), as documented in the porting guide. An optional interface and fallback would preserve an incomplete contract, so this change remains.

@binaryfire
binaryfire merged commit 6d6d1a9 into 0.4 Nov 16, 2026
51 of 52 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