From b58aa19bd8a59527a1e97e026bc1acd6e5113179 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 15 Jul 2025 21:34:41 +0100 Subject: [PATCH] Add daily email --- content/meta/index.json | 7 ++ ...e.57c15821-f744-45ce-960e-5f77d41c3ad3.yml | 4 +- ...e.5a77f50e-a593-4a7f-b2b2-1a39114e9668.yml | 79 +++++++++++++++++++ ...s.c0009260-e116-4e4b-8638-f46658a1b955.yml | 10 +++ 4 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 content/node.5a77f50e-a593-4a7f-b2b2-1a39114e9668.yml create mode 100644 content/path_alias.c0009260-e116-4e4b-8638-f46658a1b955.yml diff --git a/content/meta/index.json b/content/meta/index.json index 1f4105275..93be95065 100644 --- a/content/meta/index.json +++ b/content/meta/index.json @@ -7088,5 +7088,12 @@ ], "path_alias.8d39e49f-61f7-45eb-b163-25fb33ad9f4d": [ "node.6d274bb7-1d5a-43ca-b024-cf62cdae01aa" + ], + "node.5a77f50e-a593-4a7f-b2b2-1a39114e9668": [ + "user.b8966985-d4b2-42a7-a319-2e94ccfbb849", + "node.e3f6c728-7855-4804-8614-e2a0c08c368f" + ], + "path_alias.c0009260-e116-4e4b-8638-f46658a1b955": [ + "node.5a77f50e-a593-4a7f-b2b2-1a39114e9668" ] } \ No newline at end of file diff --git a/content/node.57c15821-f744-45ce-960e-5f77d41c3ad3.yml b/content/node.57c15821-f744-45ce-960e-5f77d41c3ad3.yml index a792785ce..ad1cdb64b 100644 --- a/content/node.57c15821-f744-45ce-960e-5f77d41c3ad3.yml +++ b/content/node.57c15821-f744-45ce-960e-5f77d41c3ad3.yml @@ -7,7 +7,7 @@ type: target_type: node_type target_uuid: a6dfb70f-21fc-46e0-aa8c-45c5d0cef75f revision_timestamp: - - value: '2025-07-07T21:13:28+00:00' + - value: '2025-07-15T00:07:11+00:00' revision_uid: - target_type: user target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849 @@ -22,7 +22,7 @@ title: created: - value: '2025-07-03T15:08:56+00:00' changed: - - value: '2025-07-07T21:13:28+00:00' + - value: '2025-07-15T00:07:11+00:00' promote: - value: false sticky: diff --git a/content/node.5a77f50e-a593-4a7f-b2b2-1a39114e9668.yml b/content/node.5a77f50e-a593-4a7f-b2b2-1a39114e9668.yml new file mode 100644 index 000000000..af2b93db8 --- /dev/null +++ b/content/node.5a77f50e-a593-4a7f-b2b2-1a39114e9668.yml @@ -0,0 +1,79 @@ +uuid: + - value: 5a77f50e-a593-4a7f-b2b2-1a39114e9668 +langcode: + - value: en +type: + - target_id: daily_email + target_type: node_type + target_uuid: 8bde1f2f-eef9-4f2d-ae9c-96921f8193d7 +revision_timestamp: + - value: '2025-07-15T20:33:32+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: 'Drupal Test Traits is not a replacement for traditional tests' +created: + - value: '2025-07-13T20:31:38+00:00' +changed: + - value: '2025-07-15T20:33:32+00:00' +promote: + - value: false +sticky: + - value: false +default_langcode: + - value: true +revision_translation_affected: + - value: true +path: + - alias: /daily/2025/07/13/drupal-test-traits-not-replacement-traditional-tests + langcode: en +body: + - value: |- + I've recently been looking into [the Drupal Test Traits project][0]. + + In my previous talks and workshops, and my email course, I haven't covered Drupal Test Traits and stuck to using the existing Drupal test types - `BrowserTestBase`, `KernelTestBase`, etc. + + I maybe assumed that it was a different approach to testing, like introducing a different testing tool. + + I wanted to make sure I understood Drupal's core test types before looking into additional things like Drupal Test Traits. + + Now I've looked into it, I know it's not a replacement for Drupal core tests - it's an extension of them. + + It uses the same PHPUnit framework, but extends it with specific traits and classes for testing an existing Drupal site rather than creating a temporary website for each test. + + This makes the setup much simpler, and easier for people to write their first working test. + + And you can mix and match - not every test needs to implement the `ExistingSiteBase` class that Drupal Test Traits provides. + + If a test is better written as a standard Functional test, you can still use the core classes as you need to. + + You can even include the specific traits you need, giving you full control and flexibility. + + I'll continue to teach the Drupal testing fundamentals, but in future versions, I'll include Drupal Test Traits too, and I'll be using it for any Drupal projects for clients or [my own website][1]. + + [0]: /daily/2025/06/18/exploring-drupal-test-traits + [1]: https://code.oliverdavies.uk/opdavies/oliverdavies.uk + format: markdown + processed: | +

I've recently been looking into the Drupal Test Traits project.

+

In my previous talks and workshops, and my email course, I haven't covered Drupal Test Traits and stuck to using the existing Drupal test types - BrowserTestBase, KernelTestBase, etc.

+

I maybe assumed that it was a different approach to testing, like introducing a different testing tool.

+

I wanted to make sure I understood Drupal's core test types before looking into additional things like Drupal Test Traits.

+

Now I've looked into it, I know it's not a replacement for Drupal core tests - it's an extension of them.

+

It uses the same PHPUnit framework, but extends it with specific traits and classes for testing an existing Drupal site rather than creating a temporary website for each test.

+

This makes the setup much simpler, and easier for people to write their first working test.

+

And you can mix and match - not every test needs to implement the ExistingSiteBase class that Drupal Test Traits provides.

+

If a test is better written as a standard Functional test, you can still use the core classes as you need to.

+

You can even include the specific traits you need, giving you full control and flexibility.

+

I'll continue to teach the Drupal testing fundamentals, but in future versions, I'll include Drupal Test Traits too, and I'll be using it for any Drupal projects for clients or my own website.

+ summary: '' +field_daily_email_cta: + - target_type: node + target_uuid: e3f6c728-7855-4804-8614-e2a0c08c368f diff --git a/content/path_alias.c0009260-e116-4e4b-8638-f46658a1b955.yml b/content/path_alias.c0009260-e116-4e4b-8638-f46658a1b955.yml new file mode 100644 index 000000000..9a36ccb57 --- /dev/null +++ b/content/path_alias.c0009260-e116-4e4b-8638-f46658a1b955.yml @@ -0,0 +1,10 @@ +uuid: + - value: c0009260-e116-4e4b-8638-f46658a1b955 +langcode: + - value: en +path: + - value: /node/5a77f50e-a593-4a7f-b2b2-1a39114e9668 +alias: + - value: /daily/2025/07/13/drupal-test-traits-not-replacement-traditional-tests +status: + - value: true