Repository navigation
Clear the Mago lint findings in the test suite - #254
Open
simon-mundy wants to merge 5 commits into
Open
simon-mundy wants to merge 5 commits into
simon-mundy wants to merge 5 commits into
Conversation
Pass optional literal arguments by name and replace namespace-shaped adapter service names with plain names, matching the documented configuration style.
Use PDO::ERRMODE_SILENT so the failing query takes the same error path without emitting a warning, drop the unreachable suppressed assertions in Sql92Test in favour of asserting the exception message, connect directly instead of swallowing exceptions, and drop unused credentials from the SQLite fixture.
…e names Rename the _get/_isset/_set/_unset/_construct tests, drop their coding standards ignore markers, camel-case the SelectTest data provider variables, and remove a redundant variable and an assignment in an argument.
Replace isset/empty/elseif in test assets and helpers, describe assertions, use a deterministic consecutive return in ResultTest, import the predicate Expression class, interpolate quoted identifiers, and drop a stale commented-out TODO fixture. Remove the lint-baseline entries these commits fixed.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Problem
lint-baseline.tomlcarried 92 Mago lint findings in the test suite (test/unit/Sql,test/unit/Adapter,test/unit/ResultSet), including:@error suppression and an emptycatch;Fix
TableIdentifierFactory::__invoke,str_replace,random_int,var_export,assert).AbstractAdapterInterfaceFactoryTestuses plain adapter service names (WriteAdapter,ReadAdapter), matching the docs, and its data providers are labelled.@suppression:PDO::ERRMODE_SILENT. The failing query takes the samefalsepath and still throwsInvalidQueryException, without emitting a warning.Sql92Test::quoteValueThrowsWithoutDriverdrops assertions that could never run after the first throw, and checks the exception message instead.catch, redundant variables and assignments inside arguments are removed._get,_isset,_set,_unsetand_constructtests get behaviour-describing camelCase names, and lose their@codingStandardsIgnoremarkers.SelectTest's provider variables are camelCased.isset,emptyandelseifare replaced (??=, early returns,array_key_exists()).Predicate\Expressionis imported instead of written as a fully qualified name.What stays the same
src/changes. No assertion is weakened, and one exception-message assertion is added.no-isset×6, where the test checks thatisset()reachesArrayAccessor__isset;halstead×2, on two data providers that are large fixture tables;excessive-parameter-listandno-boolean-flag-parameteronSelectTest::prepareStatement, whose signature has to match the shared provider's row shape.Verification
mago format --check,lint,analyzeandguardexit 0 on PHP 8.3, 8.4 and 8.5, with no stale baseline entries.0.6.x, and no warnings or notices.