test(di): prove injector hardener S1–S10 - #3420
Merged
Merged
Conversation
Pin HOLD S2/S3/S7 and add branch-killing specs for S1/S4/S5/S6/S8/S9/S10. S4 stays dotted-path fallback. No production flip. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Peter Amiri <peter@alurium.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Injector desk IDs S1–S10 were locked. HOLD pins stay unflipped. This PR only proves current behavior so a flipped conditional, empty catch, or greet-only equality would fail.
S4 stays dotted-path fallback. It is not
Wheels.ServiceNotFoundand it does not throw for a valid unmapped component path. Production still usescreateObject("component", path)afterresolveMapping()returns the name as-is.Scope
vendor/wheels/tests/specs/injector/InjectorHardenerSpec.cfcsowheels test --core --ci --filter=injectordiscovers a directoryvendor/wheels/tests/specs/di/InjectorSpec.cfc— S1 distinct identity, S5 circular throw in the recovery catchvendor/wheels/tests/specs/interfaces/InjectorInterfaceSpec.cfc— S6 skip-missingvendor/wheels/tests/_assets/di/LifecycleHookService.cfc— S8 hook probeNo production change in
Injector.cfcor the interface. Spec-only. No changelog fragment.Out: CLI Application.cfc injector, SQL-injection specs, docs/blog,
inject()in controller/services.cfc,$snapshotBindings/$restoreBindings,application.wheelsdiself-register.Desk S1–S10
getInstancecalls of the same mapping get distinct instances. Marker on the first does not appear on the second.request.$wheelsDICache.asSingleton/asRequestScopedare silent no-ops whenlastMappedNameis empty.map(b).asSingleton().to(...)flags the previous key, notb.getInstancetreats the name as a dotted component path. Does not throwWheels.DI.ServiceNotFound. Unknown path still fails as createObject, not ServiceNotFound.catch(any)assertsWheels.DI.CircularDependency, then the resolving stack is empty and a later resolve works.getMappings()returns the live struct. Mutating it, or mapping later, is visible on the same reference.onDIcompleteruns once on the constructed instance. A singleton cache hit does not run it again. Each transient runs it once on that instance.map("")thento()throwsWheels.Injector, same type asto()withoutmap().map(" ")accepts.asSingleton/asRequestScopeddoes not change the winner.Verification
Command actually run:
JSON from the same filter (
directory=wheels.tests.specs.injector):Also ran, not the driver:
Wheels CLI 4.0.6. Lucee 7.0.0.395. sqlite.
Adobe and BoxLang were not run here.
HEAD
25fe6e2eeaa382074560eaabadd93851b43cceb3Base
bb9fa68347a06fac8ebfe4959d8b5d7607bba9ba(develop after the database-adapter hardener).No closer keywords. Do not merge.