uuid: - value: 2e4827a4-0d9c-458c-86eb-d6b40f18d608 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:05+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: 'Test, then refactor' created: - value: '2024-10-20T00:00:00+00:00' changed: - value: '2025-05-11T09:00:05+00:00' promote: - value: false sticky: - value: false default_langcode: - value: true revision_translation_affected: - value: true path: - alias: /daily/2024/10/20/test-then-refactor langcode: en body: - value: |
Whether you prefer PHPUnit or Pest PHP, or if you're coding in a different language, it's important to have automated tests - especially before you refactor any code.
Before you refactor, you want to have passing tests that you're confident cover all the required functionality.
When you finish refactoring, the tests should still pass.
Then you know the functionality is the same and the code still works after it's been refactored.
If you don't have tests, how do you know everything still works, or how likely are you to do the refactor at all?
format: full_html processed: |Whether you prefer PHPUnit or Pest PHP, or if you're coding in a different language, it's important to have automated tests - especially before you refactor any code.
Before you refactor, you want to have passing tests that you're confident cover all the required functionality.
When you finish refactoring, the tests should still pass.
Then you know the functionality is the same and the code still works after it's been refactored.
If you don't have tests, how do you know everything still works, or how likely are you to do the refactor at all?
summary: null field_daily_email_cta: { }