migrify/phpunit-upgrader

This package is abandoned and no longer maintained. The author suggests using the symplify/phpunit-upgrader package instead.

Upgrade PHPUnit tests with smart helping hand


README

Downloads total

Upgrade PHPUnit tests with smart helping hand.

Install

composer require symplify/phpunit-upgrader --dev

Usage

1. Change assertContains() on string calls to assertStringContainsString()

vendor/bin/phpunit-upgrader assert-contains /tests --error-report-file report.txt

Where report.txt is the output of PHPUnit run with fails:

1) Whatever::whatever
TypeError: Argument 2 passed to PHPUnit\Framework\Assert::assertContains() must be iterable, string given, called in somePath.php on line 100

2. Add void to setUp() and tearDown() methods

vendor/bin/phpunit-upgrader voids /tests

Report Issues

In case you are experiencing a bug or want to request a new feature head over to the Symplify monorepo issue tracker

Contribute

The sources of this package are contained in the Symplify monorepo. We welcome contributions for this package on symplify/symplify.