tome export

This commit is contained in:
Oliver Davies 2025-05-30 02:14:32 +01:00
parent 52278c3a53
commit 7a52afab5f
960 changed files with 3670 additions and 2229 deletions

View file

@ -82,15 +82,15 @@
],
"body": [
{
"value": "\n <p><a href=\"/daily\/2024\/02\/07\/running-tests-in-parallel-with-paratest\">In yesterday's email<\/a>, I mentioned parallel testing and speeding up your tests by running them in parallel.<\/p>\n\n<p>Something else I've been experimenting with recently in architectural testing with PHPat.<\/p>\n\n<p>For example, ensuring classes within a namespace are <code>final<\/code> or not, that Controller classes all extend <code>ControllerBase<\/code> and have the Controller suffix in their names.<\/p>\n\n<p>Going forward, I'd like to ensure that each Drupal module only uses its own classes and is separated, as I recently had an issue where I deleted a class method in one module only to find it was used in a different module.<\/p>\n\n<p>Here's what I have so far for my <a href=\"/atdc\">testing course codebase<\/a>:<\/p>\n\n<pre><code class=\"language-php\">final class ArchitectureTest {\n\n public function test_classes_should_be_final(): Rule {\n return PHPat::rule()\n -&gt;classes(Selector::inNamespace('Drupal\\atdc'))\n -&gt;shouldBeFinal();\n }\n\n public function test_controllers_should_extend_ControllerBase(): Rule {\n return PHPat::rule()\n -&gt;classes(Selector::inNamespace('Drupal\\atdc\\Controller'))\n -&gt;shouldExtend()\n -&gt;classes(Selector::classname(ControllerBase::class));\n }\n\n public function test_controllers_should_have_the_Controller_suffix(): Rule {\n return PHPat::rule()\n -&gt;classes(Selector::inNamespace('Drupal\\atdc\\Controller'))\n -&gt;shouldBeNamed(\n classname: '\/Controller$\/',\n regex: TRUE,\n );\n }\n\n}\n<\/code><\/pre>\n\n<p>I plan to continue expanding this configuration as I become more familiar with PHPat, and because it's a PHPStan extension, it's already available to run within my projects locally and within the CI pipeline.<\/p>\n\n ",
"value": "\n <p><a href=\"\/daily\/2024\/02\/07\/running-tests-in-parallel-with-paratest\">In yesterday's email<\/a>, I mentioned parallel testing and speeding up your tests by running them in parallel.<\/p>\n\n<p>Something else I've been experimenting with recently in architectural testing with PHPat.<\/p>\n\n<p>For example, ensuring classes within a namespace are <code>final<\/code> or not, that Controller classes all extend <code>ControllerBase<\/code> and have the Controller suffix in their names.<\/p>\n\n<p>Going forward, I'd like to ensure that each Drupal module only uses its own classes and is separated, as I recently had an issue where I deleted a class method in one module only to find it was used in a different module.<\/p>\n\n<p>Here's what I have so far for my <a href=\"\/atdc\">testing course codebase<\/a>:<\/p>\n\n<pre><code class=\"language-php\">final class ArchitectureTest {\n\n public function test_classes_should_be_final(): Rule {\n return PHPat::rule()\n -&gt;classes(Selector::inNamespace('Drupal\\atdc'))\n -&gt;shouldBeFinal();\n }\n\n public function test_controllers_should_extend_ControllerBase(): Rule {\n return PHPat::rule()\n -&gt;classes(Selector::inNamespace('Drupal\\atdc\\Controller'))\n -&gt;shouldExtend()\n -&gt;classes(Selector::classname(ControllerBase::class));\n }\n\n public function test_controllers_should_have_the_Controller_suffix(): Rule {\n return PHPat::rule()\n -&gt;classes(Selector::inNamespace('Drupal\\atdc\\Controller'))\n -&gt;shouldBeNamed(\n classname: '\/Controller$\/',\n regex: TRUE,\n );\n }\n\n}\n<\/code><\/pre>\n\n<p>I plan to continue expanding this configuration as I become more familiar with PHPat, and because it's a PHPStan extension, it's already available to run within my projects locally and within the CI pipeline.<\/p>\n\n ",
"format": "full_html",
"processed": "\n <p><a href=\"/daily\/2024\/02\/07\/running-tests-in-parallel-with-paratest\">In yesterday's email<\/a>, I mentioned parallel testing and speeding up your tests by running them in parallel.<\/p>\n\n<p>Something else I've been experimenting with recently in architectural testing with PHPat.<\/p>\n\n<p>For example, ensuring classes within a namespace are <code>final<\/code> or not, that Controller classes all extend <code>ControllerBase<\/code> and have the Controller suffix in their names.<\/p>\n\n<p>Going forward, I'd like to ensure that each Drupal module only uses its own classes and is separated, as I recently had an issue where I deleted a class method in one module only to find it was used in a different module.<\/p>\n\n<p>Here's what I have so far for my <a href=\"/atdc\">testing course codebase<\/a>:<\/p>\n\n<pre><code class=\"language-php\">final class ArchitectureTest {\n\n public function test_classes_should_be_final(): Rule {\n return PHPat::rule()\n -&gt;classes(Selector::inNamespace('Drupal\\atdc'))\n -&gt;shouldBeFinal();\n }\n\n public function test_controllers_should_extend_ControllerBase(): Rule {\n return PHPat::rule()\n -&gt;classes(Selector::inNamespace('Drupal\\atdc\\Controller'))\n -&gt;shouldExtend()\n -&gt;classes(Selector::classname(ControllerBase::class));\n }\n\n public function test_controllers_should_have_the_Controller_suffix(): Rule {\n return PHPat::rule()\n -&gt;classes(Selector::inNamespace('Drupal\\atdc\\Controller'))\n -&gt;shouldBeNamed(\n classname: '\/Controller$\/',\n regex: TRUE,\n );\n }\n\n}\n<\/code><\/pre>\n\n<p>I plan to continue expanding this configuration as I become more familiar with PHPat, and because it's a PHPStan extension, it's already available to run within my projects locally and within the CI pipeline.<\/p>\n\n ",
"processed": "\n <p><a href=\"http:\/\/default\/daily\/2024\/02\/07\/running-tests-in-parallel-with-paratest\">In yesterday's email<\/a>, I mentioned parallel testing and speeding up your tests by running them in parallel.<\/p>\n\n<p>Something else I've been experimenting with recently in architectural testing with PHPat.<\/p>\n\n<p>For example, ensuring classes within a namespace are <code>final<\/code> or not, that Controller classes all extend <code>ControllerBase<\/code> and have the Controller suffix in their names.<\/p>\n\n<p>Going forward, I'd like to ensure that each Drupal module only uses its own classes and is separated, as I recently had an issue where I deleted a class method in one module only to find it was used in a different module.<\/p>\n\n<p>Here's what I have so far for my <a href=\"http:\/\/default\/atdc\">testing course codebase<\/a>:<\/p>\n\n<pre><code class=\"language-php\">final class ArchitectureTest {\n\n public function test_classes_should_be_final(): Rule {\n return PHPat::rule()\n -&gt;classes(Selector::inNamespace('Drupal\\atdc'))\n -&gt;shouldBeFinal();\n }\n\n public function test_controllers_should_extend_ControllerBase(): Rule {\n return PHPat::rule()\n -&gt;classes(Selector::inNamespace('Drupal\\atdc\\Controller'))\n -&gt;shouldExtend()\n -&gt;classes(Selector::classname(ControllerBase::class));\n }\n\n public function test_controllers_should_have_the_Controller_suffix(): Rule {\n return PHPat::rule()\n -&gt;classes(Selector::inNamespace('Drupal\\atdc\\Controller'))\n -&gt;shouldBeNamed(\n classname: '\/Controller$\/',\n regex: TRUE,\n );\n }\n\n}\n<\/code><\/pre>\n\n<p>I plan to continue expanding this configuration as I become more familiar with PHPat, and because it's a PHPStan extension, it's already available to run within my projects locally and within the CI pipeline.<\/p>\n\n ",
"summary": null
}
],
"feeds_item": [
{
"imported": "1970-01-01T00:33:45+00:00",
"imported": "1970-01-01T00:32:50+00:00",
"guid": null,
"hash": "455ff869c592cdd12244b2264b5b2dff",
"target_type": "feeds_feed",