Skip to content

Comments

Refactor/improve readability#345

Merged
recca0120 merged 67 commits intomainfrom
refactor/improve-readability
Feb 14, 2026
Merged

Refactor/improve readability#345
recca0120 merged 67 commits intomainfrom
refactor/improve-readability

Conversation

@recca0120
Copy link
Owner

No description provided.

@recca0120 recca0120 force-pushed the refactor/improve-readability branch 2 times, most recently from ca09e91 to f5ac52f Compare February 14, 2026 15:57
Add project configuration for Claude Code with TDD workflow rules
and comprehensive project architecture documentation.
- Handler: extract createTestRunner, createProcesses, collectCoverage
  from runTestQueue to separate concerns
- TestRunnerEventProxy: replace 17 boilerplate forwarding methods with
  dynamic event registration in constructor
- TestRunner: extract handleProcessError/handleProcessClose, improve
  emit type safety with generics
- Builder: extract ensureVariablePlaceholders, normalizeQuotedVariables,
  removeEmptyPhpArgs, substituteVariables from create method
- ProblemMatcher: extract appendFaultDetails, rename isResult to
  isDispatchable for clarity
- extension: extract activate into focused helper functions
  (createConfiguration, loadInitialConfiguration, setupTestController,
  etc.)
…conflict

- CommandHandler → TestCommandRegistry: clearly indicates VS Code
  command registration, not shell command handling
- CommandBuilder/ → ProcessBuilder/: clearly indicates child process
  construction, not abstract command building
- Builder → ProcessBuilder: class name matches directory name
- Update all imports, references, skills docs, and CLAUDE.md
- Rename Element to XmlElement to clarify it wraps XML nodes
- Fix variable shadow in TestHierarchyBuilder (testDefinition → namespaceDefinition)
- Rename length → ancestorDepth, finished → completedAncestor
- Unify loop variables: test/item → testItem consistently
- Rename TransformerFactory.factory() → create()
- Rename FilterStrategyFactory.getStrategy() → create()
- Rename temp → incompleteLineBuffer in TestRunnerProcess
- Rename emitResult → emitTestResult with specific parameter name
- Fix PathReplacer accumulator shadow (path → result)
- Fix TestResultObserver: current → matchingDetail, callback → updateTestRun
- Fix generic item → testItem in extension.ts and Handler.ts
TeamcityEvent keys are already included in EventResultMap,
so the intersection with { [p in TeamcityEvent]: ... } was a no-op.
Add tests for TestRunnerObserver type and TestRunnerEventProxy behavior.
Remove redundant `& { [p in TeamcityEvent]: ... }` intersection since
all TeamcityEvent keys are already present in EventResultMap.
- length → ancestorDepth
- finished → completedAncestor
- testDefinition shadow → namespaceDefinition
- temp → incompleteLineBuffer
- emitResult → emitTestResult
- current → matchingDetail
- callback → updateTestRun
- test → testItem in doRun
- test → testItem in loop destructuring
- test → requestedItem in findTestsByRequest
- item → current in removeTestItems
- EscapeValue: replace parallel arrays with tuple mappings to prevent index mismatch
- TestHierarchyBuilder: replace Proxy hack with simple object literal
- Handler: extract CoverageCollector, TestRunnerFactory, and TestDiscovery
- extension.ts: eliminate implicit global references by passing dependencies as parameters
…on class

Convert activate() + 11 free functions into a PHPUnitExtension class with
private methods, eliminating long parameter lists by using instance properties
for shared state (ctrl, testCollection, handler, watchingTests, etc.).
Public API (export activate) remains unchanged as a thin wrapper.
Replace manual object construction in PHPUnitExtension.activate() with
an InversifyJS container using toDynamicValue bindings, keeping existing
classes unchanged (no decorators added).
- Add affectsConfiguration('phpunit') filter to onDidChangeConfiguration
  so config updates only trigger on phpunit setting changes
- Dispose fileChangedEmitter by pushing to context.subscriptions
- Move phpUnitXML from module-level singleton to instance property to
  avoid shared state across deactivate/reactivate cycles
- Fix "without phpunit.xml" test to use real objects instead of spy
- Document pre-existing test failures and testing principles
Replace dynamic constructor-based event registration with explicit
typed methods to restore full TypeScript type safety. The [key: string]: any
index signature defeated type checking on the entire class.
Move PHPUnitXML, Configuration, EventEmitter<Uri>, and TestCommandRegistry
into the InversifyJS container, reducing createContainer parameters from 4
to 2 (only VS Code API objects: TestController, OutputChannel).
…estRunner from PHPUnitExtension

Split PHPUnitExtension responsibilities into three focused classes:
- TestFileDiscovery: test file discovery and initial configuration loading
- TestFileWatcher: workspace file change listeners
- ContinuousTestRunner: continuous/watch mode test execution
Inline private methods, remove class wrapper, and organize activate()
into clear sections: dependency resolution, initial load, listeners,
test controller, run profiles, commands, and disposables.
- Remove duplicate Configuration instantiation in TestFileDiscovery
- Inject Handler into TestCommandRegistry, remove rerun() parameter
- Move CoverageCollector and TestDiscovery into DI container
- Bind MessageObserver in container, reduce TestRunnerFactory pass-through
- Add TestFileDiscovery.reloadAll() to encapsulate reload pattern
- Inject TestFileDiscovery into TestCommandRegistry, remove reload callback
- Export MessageObserver from Observers barrel
Move OutputChannelObserver's request param to a setter so it can be
bound as a singleton in the DI container. TestRunnerFactory now takes
only OutputChannelObserver and MessageObserver, removing the three
pass-through parameters (outputChannel, configuration, printer).
setup-debug.js was tied to the consolidated docker-compose.yml which
has been reverted. Restore tasks.json to main state without Docker tasks.
- Change getPhpUnitVersion() to use detectPhpUnitStubs() instead of root vendor
- Convert OutputChannelObserver tests to describe.each(detectPhpUnitStubs())
  with PHPUnit 12 die() Fatal error handling
- Merge describe('PHPUnit') and describe('Xdebug') into describe.each(detectPhpUnitStubs())
- Merge describe('PEST') into describe.each(detectPestStubs())
- Replace describe('paratest') with describe.each(detectParatestStubs())
- Add detectParatestStubs() helper, remove unused getPhpVersion()
- Fix pest-v3 expected values to match current 3.8.5 behavior
…nt naming

- Extract resolveExpected helper to centralize version-conditional logic
- Extract expectSpawnCalled helper to reduce spawn assertion boilerplate
- Simplify command registration assertions with loop
- Rename getRunProfile/runProfile to getTestRunProfile/testRunProfile to match extension.ts
- Remove unused method variables
- Simplify array coercion with [ids].flat()
- PHP 7.4: PHPUnit v9 (phpvfscomposer path, PHP < 8)
- PHP 8.2: PHPUnit v9/v10/v11, Pest v2/v3
- PHP 8.4: all stubs (v9-v12, Pest v2-v4)
- Install composer deps per vN/ directory instead of root
- Remove special-case PHPUnit 10.5.30 for PHP 8.1
- Use shell: bash for cross-platform consistency
- Add continue-on-error for Windows (shivammathur/setup-php broken
  since runner images shipped PHP 8.5, actions/runner-images#13603)
- 9 jobs (3 OS × 3 PHP) down from 27 (3 OS × 9 PHP)
@recca0120 recca0120 force-pushed the refactor/improve-readability branch from f5ac52f to ebe1f92 Compare February 14, 2026 16:21
- Add getGroupFilter() to FilterStrategy base class; ClassFilterStrategy
  includes --group flag when class has group annotations/attributes
- Add #[Group('integration')] attribute to AssertionsTest.php and
  AttributeTest.php fixtures for parser and integration test coverage
- Add extension tests: run class with group, run method with group,
  run at cursor with group
- Update line numbers across test files for fixture changes
@recca0120 recca0120 force-pushed the refactor/improve-readability branch 10 times, most recently from 062f52e to 8105ac2 Compare February 14, 2026 20:29
@recca0120 recca0120 force-pushed the refactor/improve-readability branch from 8105ac2 to a07e8f2 Compare February 14, 2026 20:35
- Replace phpUnitProject() with Uri.file(phpUnitProject()).fsPath in
  expectSpawnCalled args to match production code behavior on Windows
- Keep only cwd comparison case-insensitive (drive letter ambiguity)
- Replace inline import('../../PHPUnit').TestSuiteFinished with proper
  top-level type imports in CollisionPrinter and OutputFormatter tests
- Use sort -V for numerical ordering (v9, v10, v11, v12 instead of v10, v11, v12, v9)
- Use composer install instead of update to leverage existing lock files
- Add --ignore-platform-reqs to avoid failures when PHP version doesn't
  match stub requirements (runtime detection handles incompatibility)
- Define minimum PHP version per stub (e.g. PHPUnit v12 needs PHP >=8.3)
- Skip composer install for stubs incompatible with matrix PHP version
- Use composer install (lock file) instead of composer update
- Use sort -V for correct version ordering (v9, v10, v11, v12)
Replace associative array with POSIX-compatible string lookup
using tr/grep/cut for parsing env lookup table.
@recca0120 recca0120 merged commit 6f2ec9d into main Feb 14, 2026
9 checks passed
@recca0120 recca0120 deleted the refactor/improve-readability branch February 14, 2026 21:04
@codecov
Copy link

codecov bot commented Feb 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (a866a3b) to head (0d121f7).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main   #345       +/-   ##
=========================================
- Coverage   95.42%      0   -95.43%     
=========================================
  Files          60      0       -60     
  Lines        4520      0     -4520     
  Branches     1014      0     -1014     
=========================================
- Hits         4313      0     -4313     
+ Misses        202      0      -202     
+ Partials        5      0        -5     
Flag Coverage Δ
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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