Skip to content

test(tracing): Remove DBAL v2-only errorCode test from DBAL v4 connection test to drop baseline entry - #1122

Merged
stayallive merged 2 commits into
masterfrom
junior/phpstan-dbal-v4-test-dead-error-code
Nov 16, 2026
Merged

stayallive merged 2 commits into
masterfrom
junior/phpstan-dbal-v4-test-dead-error-code

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Removes this entry from phpstan-baseline.neon:

Trying to mock an undefined method errorCode() on class Doctrine\DBAL\Driver\Connection. (tests/Tracing/Doctrine/DBAL/TracingDriverConnectionForV4Test.php)

TracingDriverConnectionForV4Test skips the whole class unless DBAL 4 is installed, but testErrorCode() skips itself unless DBAL 2 is installed. Because of that, it never runs. It is also the only place that mocks errorCode(), which DBAL 4's Connection does not have. This PR deletes that unreachable test. Only test code changes, and shipped code stays the same.

via automation sched_a59acc45df166a80a839d0b32321e740 · Run ID sched_a59acc45df166a80a839d0b32321e740:1794819600000.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 16, 2026 09:08
…AL v4

The DBAL v4 connection test was copied from the v2/v3 test and kept the
v2/v3 version guards, so all four errorCode/errorInfo tests were always
skipped under the class-level DBAL v4 requirement.

- Remove testErrorInfo, which mocks errorInfo() that DBAL 4's driver
  Connection does not have, and drop its PHPStan baseline entry.
- Remove the DBAL v3 guards from the BadMethodCallException tests so they
  cover the path DBAL 4 actually takes, and assert on the V4 class name
  that __METHOD__ produces.
@stayallive

Copy link
Copy Markdown
Collaborator

There were also some other copy-pasts codes left from other DBAL versions. Added some more cleanup.

@stayallive
stayallive marked this pull request as ready for review November 16, 2026 09:56
@stayallive
stayallive requested a review from a team as a code owner November 16, 2026 09:56
@stayallive
stayallive enabled auto-merge (squash) November 16, 2026 09:56
@stayallive
stayallive merged commit 02c4e13 into master Nov 16, 2026
55 checks passed
@stayallive
stayallive deleted the junior/phpstan-dbal-v4-test-dead-error-code branch November 16, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant