This repository was archived by the owner on Jan 29, 2020. It is now read-only.
Use v2-compatible EventManager instantiation when lazy-loading#73
Merged
weierophinney merged 1 commit intozendframework:masterfrom Feb 12, 2016
weierophinney:hotfix/71
Merged
Use v2-compatible EventManager instantiation when lazy-loading#73weierophinney merged 1 commit intozendframework:masterfrom weierophinney:hotfix/71
weierophinney merged 1 commit intozendframework:masterfrom
weierophinney:hotfix/71
Conversation
Per #71, `getEventManager()`, when lazy-loading an `EventManager`, was using the v3 syntax, instead of v2-compatible syntax, causing identifiers to break under v2 (as they are now injected with a `SharedEventManager` instance instead). This patch: - Adds a compatiblity test to ensure that the usage works on both v2 and v3. - Fixes the lazy-loading code to instantiate and then inject identifiers.
This was referenced Feb 12, 2016
| /** | ||
| * @depends testCanLazyLoadEventManager | ||
| */ | ||
| public function testLazyLoadedEventManagerIsInjectedProperlyWithDefaultIdentifiers(EventManager $events) |
Member
There was a problem hiding this comment.
To be sure, I'd also add an @coversNothing test that triggers an event (any event) on the event manager and on its attached shared event manager (integration test)
Member
Author
There was a problem hiding this comment.
Ugh, missed this comment!
That said, the other tests are already testing triggering of events, and that works between both versions. The difference, however, is that those inject an EM instance (or mock) to do so, so they're primarily testing that the correct calls are made. I did, however, have issues crop up in testing yesterday when completing the migration patch due to compatibility issues, which I was able to fix. I'll see if I can come up with an additional test to be on the safe-side, though.
weierophinney
added a commit
that referenced
this pull request
Feb 12, 2016
weierophinney
added a commit
that referenced
this pull request
Feb 12, 2016
Close #73 Fixes #71 Fixes #72 Fixes zendframework/zendframework#7671 Fixes bjyoungblood/BjyAuthorize#303
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Per #71,
getEventManager(), when lazy-loading anEventManager, was using the v3 syntax, instead of v2-compatible syntax, causing identifiers to break under v2 (as they are now injected with aSharedEventManagerinstance instead).This patch:
This also addresses #72, as the problem presented in that report is due to the fact that the
SharedEventManagerwas injected as an identifier, and identifiers are only allowed to be strings or integers.