uuid: - value: e292ffd7-ca03-4054-89d1-90ffbae8d1b0 langcode: - value: en type: - target_id: daily_email target_type: node_type target_uuid: 8bde1f2f-eef9-4f2d-ae9c-96921f8193d7 revision_timestamp: - value: '2025-05-11T09:00:22+00:00' revision_uid: - target_type: user target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849 revision_log: { } status: - value: true uid: - target_type: user target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849 title: - value: 'PHPUnit or Pest?' created: - value: '2024-01-20T00:00:00+00:00' changed: - value: '2025-05-11T09:00:22+00:00' promote: - value: false sticky: - value: false default_langcode: - value: true revision_translation_affected: - value: true path: - alias: /daily/2024/01/20/phpunit-or-pest langcode: en body: - value: |
A recent discussion has started about which testing framework should be the default one used in Laravel.
PHPUnit or Pest.
I've used both, and I like both.
I'm more familiar with classes, object-orientated code and PHPUnit, but for people who are more familiar with JavaScript and the Jest testing framework, Pest may be the better option.
Its expectation API, where you can chain multiple assertions on the same expectation, is helpful, although I don't mind some repetition in PHPUnit tests.
Pest tests can become abstract, especially with some of their one-line example tests.
Whether you pick PHPUnit, Pest or another framework like Behat or Codeception, the main thing is you're taking the time to write automated tests for your code, which is valuable whichever testing tool you use.
format: full_html processed: |A recent discussion has started about which testing framework should be the default one used in Laravel.
PHPUnit or Pest.
I've used both, and I like both.
I'm more familiar with classes, object-orientated code and PHPUnit, but for people who are more familiar with JavaScript and the Jest testing framework, Pest may be the better option.
Its expectation API, where you can chain multiple assertions on the same expectation, is helpful, although I don't mind some repetition in PHPUnit tests.
Pest tests can become abstract, especially with some of their one-line example tests.
Whether you pick PHPUnit, Pest or another framework like Behat or Codeception, the main thing is you're taking the time to write automated tests for your code, which is valuable whichever testing tool you use.
summary: null field_daily_email_cta: { }