{ "uuid": [ { "value": "a4efc095-f78d-45ae-854d-fc52c8afa41b" } ], "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:08+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": "Docblocks or attributes?" } ], "created": [ { "value": "2024-08-15T00:00:00+00:00" } ], "changed": [ { "value": "2025-05-11T09:00:08+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2024\/08\/15\/docblocks-or-attributes", "langcode": "en" } ], "body": [ { "value": "\n

As Drupal 11 uses PHPUnit 10, we can now use the #[Test]<\/code> attribute instead of the \/** @test *\/<\/code> annotation for our test methods.<\/p>\n\n

For example:<\/p>\n\n

\/\/ Before.\n\n\/** @test *\/\npublic function it_returns_the_endpoint()\n\n\/\/ After.\n\n#[Test]\npublic function it_returns_the_endpoint()\n<\/code><\/pre>\n\n

Annotations have started to be replaced<\/a> in parts of Drupal since 10.2, so it's nice to be able to do it with tests, too.<\/p>\n\n

Which do you prefer?<\/p>\n\n ", "format": "full_html", "processed": "\n

As Drupal 11 uses PHPUnit 10, we can now use the #[Test]<\/code> attribute instead of the \/** @test *\/<\/code> annotation for our test methods.<\/p>\n\n

For example:<\/p>\n\n

\/\/ Before.\n\n\/** @test *\/\npublic function it_returns_the_endpoint()\n\n\/\/ After.\n\n#[Test]\npublic function it_returns_the_endpoint()\n<\/code><\/pre>\n\n

Annotations have started to be replaced<\/a> in parts of Drupal since 10.2, so it's nice to be able to do it with tests, too.<\/p>\n\n

Which do you prefer?<\/p>\n\n ", "summary": null } ] }