Skip to content

PHPUnit to Pest Converter#263

Merged
mattstauffer merged 7 commits intomainfrom
shift-168162
Mar 2, 2026
Merged

PHPUnit to Pest Converter#263
mattstauffer merged 7 commits intomainfrom
shift-168162

Conversation

@mattstauffer
Copy link
Member

This pull request contains changes for migrating your test suite from PHPUnit to Pest automated by the Pest Converter.

Before merging, you need to:

  • Checkout the shift-168162 branch
  • Review all of the comments below for additional changes
  • Run composer update to install Pest with your dependencies
  • Run vendor/bin/pest to verify the conversion

@mattstauffer
Copy link
Member Author

ℹ️ Shift detected you are running Laravel. While Shift added a default tests/Pest.php to your project, you may continue to use any setup or helper methods within the tests/TestCase.php class as before. Over time, you may move these to the Pest configuration file.

@mattstauffer
Copy link
Member Author

ℹ️ Shift converted common PHPUnit assertions to Pest expectations. However, there may also be opportunities to chain your expectations together.

For example:

// Before
expect($comment)->toBeArray();
expect($comment)->toHaveCount(3);
expect($comment)->toContain('foo');

// After
expect($comment)->toBeArray()->toHaveCount(3)->toContain('foo');

@mattstauffer
Copy link
Member Author

ℹ️ By default, Pest executes your tests sequentially within a single process. However, you may significantly decrease the time needed to run your tests by utilizing the --parallel option. You may review the documentation on parallel testing for additional details.

@mattstauffer mattstauffer merged commit e1f56cd into main Mar 2, 2026
2 checks passed
@mattstauffer mattstauffer deleted the shift-168162 branch March 2, 2026 14:49
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.

2 participants