test(setup): Improve db detection and web-root resolution coverage - #62773
Draft
joshtrichards wants to merge 4 commits into
Draft
test(setup): Improve db detection and web-root resolution coverage#62773joshtrichards wants to merge 4 commits into
joshtrichards wants to merge 4 commits into
Conversation
Signed-off-by: Josh <josh.t.richards@gmail.com>
- `getSupportedDatabases(true)` bypasses system configuration and evaluates all known DB types. - unknown configured values are silently ignored, while later valid values are retained. - PDO versus function availability probes are dispatched the expected number of times and with the expected callable. - non-CLI `findWebRoot()` must not access `overwrite.cli.url`; it returns `\OC::$WEBROOT`, defaulting to '/' and also handling sub-directory installs. Signed-off-by: Josh <josh.t.richards@gmail.com>
The existing test fixture mocks `getAvailableDbDriversForPdo()` itself. This adds a separate partial mock that mocks only `class_exists()`, which is testable after fixing Setup to use the $this->class_exists() wrapper it already has in it... Signed-off-by: Josh <josh.t.richards@gmail.com>
The wrapper was already there; just wasn't being used. Signed-off-by: Josh <josh.t.richards@gmail.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.
Summary
Improve
SetupTestcoverage for database detection and web-root resolution.oci_connectavailability check.getSupportedDatabases(true)(allowAllDatabases) without reading configuration.findWebRoot()behavior, including the/fallback.\OC::$CLIand\OC::$WEBROOTstate safely in the web-root tests.class_exists()wrapper, making the unavailable-PDO path unit-testable.TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)