Ability to test using local instance of firebase #452
Replies: 2 comments
-
I absolutely understand your need, but I'm not sure I can provide this with the current implementation of the SDK. Environment variables would become too messy over time (the keys URL would certainly not remain the only one that needs to be configurable), and a "clean" implementation of configurable URLs via the Factory will require - as you said - quite some modifications in the code (I just spent an hour trying to come up with something 😅 ) I do believe that you could get closer to what you're looking for by extending/overriding the Factory class and its methods, specifically the Another approach could be to wrap the SDK calls in an application service and let the application service handle things differently depending on the environment, but I'm just thinking out loud here. To be clear: I usually strive for making things easier and more enjoyable for users of the SDK, but in this case, I feel it would be too big of an endeavor to do so without changes so big that I would rather invest the time in a full rewrite of the SDK 🙈 |
Beta Was this translation helpful? Give feedback.
-
thanks for your quick answer, I understand perfectly your position currently I'm doing the wrapper solution, but I prefer to keep this for unittest and to have the integrationtest / local env exercising as much as possible the whole code, vendor included, as I've been bitten in the past by bugs in the 3rd party SDK that was not discovered during the CI ( because bypassed by the mocks at the code level) and not discovered during manual QA because it was a edge case (the 3rd party library going in a crazy retry loop when the service was timeout-ing) anyway thanks for taking the time to investigate deeply into my problem , very much appreciated :) |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
For integration test (where we don't want the identifier to conflict, we want the ability to simulate network issue etc.) and local testing (where we want to be able to run our server without access to the internet, in the train/plane etc.) we want to use a local http server implementing the same endpoint as firebase (we already have that for S3 , Zendesk , Stripe etc. )
However Kreait/firebase-php does not let us configure some of the URL that are hardcoded like
Describe the solution you'd like
It should be possible to override these either (both are not needed, only one would be already great):
Additional context
I can propose a PR for 1) if you're ok with this feature request
Beta Was this translation helpful? Give feedback.
All reactions