Skip to content

Blink: port 5 PhpUnit fixers (strict, assert new names, mock, dedicate assert internal type, namespaced) - #280

Merged
TomasVotruba merged 1 commit into
mainfrom
blink-port-phpunit
Nov 4, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
blink-port-phpunit

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Ports a batch of PHP-CS-Fixer PhpUnit fixers to the Go blink engine. Each landed fixer mirrors its PHP-CS-Fixer 3.95 source faithfully, is registered in rules.All() with its upstream getPriority() value, and carries a parity test whose expected outputs were generated by running PHP-CS-Fixer 3.95 itself. No fixer was added to the config/set/ prepared sets.

Landed

  • PhpUnitStrictFixer - assertEquals/assertNotEquals/assertAttributeEquals/assertAttributeNotEquals to their strict Same variants, for 2 or 3 argument calls; honors the assertions option.
  • PhpUnitAssertNewNamesFixer - renames deprecated assertions (assertFileNotExists to assertFileDoesNotExist, assertRegExp to assertMatchesRegularExpression, ...).
  • PhpUnitMockFixer - getMock/getMockWithoutInvokingTheOriginalConstructor to createMock/createPartialMock; honors the target option.
  • PhpUnitDedicateAssertInternalTypeFixer - assertInternalType("array", $x) to assertIsArray($x) and the negated forms, with anonymous-class skipping.
  • PhpUnitNamespacedFixer - old underscore class names (PHPUnit_Framework_TestCase) to the namespaced form, with the dedicated class map and import-aware short-name substitution; honors the target option.

Skipped (deferred for true-parity confidence)

  • PhpUnitSizeClassFixer, PhpUnitInternalClassFixer, PhpUnitTestClassRequiresCoversFixer - need a faithful WhitespacesAware doc-block create/reflow plus attribute FQCN prevention.
  • PhpUnitDataProviderStaticFixer, PhpUnitDataProviderReturnTypeFixer, PhpUnitDataProviderNameFixer, PhpUnitDataProviderMethodOrderFixer - need DataProviderAnalyzer (attribute FQCN resolution, method/return-type analysis, method reordering).
  • PhpUnitExpectationFixer - multi-line indentation-sensitive statement rewriting.
  • PhpUnitDedicateAssertFixer - multi-branch (instanceof, count/sizeof, argument swapping) rewriting.
  • PhpUnitNoExpectationAnnotationFixer, PhpUnitAttributesFixer - annotation to method/attribute conversion with FQCN resolution.
  • PhpUnitTestCaseStaticMethodCallsFixer - large static-method registry plus call-context analysis.

Partial but correct beats complete but wrong: the skipped fixers rest on analyzers (attribute FQCN resolution, doc-block reflow, type inference) that cannot yet be matched with confidence.

Gates

go build, go vet, go test -race, gofmt -l -s, go fix -diff, modernize and golangci-lint all clean. bin/rule-counts.sh --check up to date (blink 257).

@TomasVotruba
TomasVotruba force-pushed the blink-port-phpunit branch 5 times, most recently from 4bd7f86 to d3ceec3 Compare November 4, 2026 17:58
@TomasVotruba
TomasVotruba merged commit f2b26f6 into main Nov 4, 2026
@TomasVotruba
TomasVotruba deleted the blink-port-phpunit branch November 4, 2026 18:00
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