Skip to content

refactor(Tests): migrate OpenApiTestCase to extracted traits - #2157

Merged
DerManoMann merged 2 commits into
zircote:masterfrom
DerManoMann:refactor/testcase-concerns
Sep 3, 2026
Merged

refactor(Tests): migrate OpenApiTestCase to extracted traits#2157
DerManoMann merged 2 commits into
zircote:masterfrom
DerManoMann:refactor/testcase-concerns

Conversation

@DerManoMann

@DerManoMann DerManoMann commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Extract UsesFixtures trait (fixture()/fixtures() path helpers)
  • Compose ExpectsLogEntries, AssertsSpecEquals, and UsesFixtures into OpenApiTestCase
  • Migrate all 15 test files from old logger API (assertOpenApiLogEntryContains, ignoreLogEntries, getTrackingLogger) to the ExpectsLogEntries trait API (expectLogEntry, allowLogEntry, trackingLogger)
  • Remove dead initializeProcessors() method (zero callers)
  • Move SourceScannerTest off OpenApiTestCase to plain TestCase — it needed nothing classic
  • Add allowClassicDebugNoise() hook to suppress the "Analysing source:" and "JetBrains" debug entries the old logger silently dropped

What remains on OpenApiTestCase is classic-only: getContext, getAnalyzer, processorPipeline, analysisFromFixtures, annotationsFromDocBlockParser, createOpenApiWithInfo, allAnnotationClasses, allAttributeClasses, getTypeResolver, getTypeResolvers. All deletable with classic in v8.

Test plan

  • Full test suite passes (1877 tests, 16M assertions)
  • phpstan clean
  • CI green

Extract UsesFixtures trait and compose ExpectsLogEntries, AssertsSpecEquals
and UsesFixtures into OpenApiTestCase. Migrate all test files from the old
logger API to ExpectsLogEntries. Remove dead initializeProcessors() and move
SourceScannerTest to plain TestCase.

What remains on OpenApiTestCase is classic-only and deletable with classic
in v8.

Written with Claude.
@DerManoMann
DerManoMann merged commit 46a9cbc into zircote:master Sep 3, 2026
18 checks passed
DerManoMann added a commit to DerManoMann/swagger-php that referenced this pull request Sep 3, 2026
Add zircote#2154 (input validation), zircote#2155 (ref escaping), zircote#2156 (Server
summaries) and zircote#2157 (OpenApiTestCase trait migration) to the merged
list. Remove PR 10 from the suggested order and move its full write-up
to the archive.
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