Commit graph

84 commits

Author SHA1 Message Date
Oliver Davies 941a58ed6a Upgrade to Drupal 11 2024-08-10 11:58:21 +01:00
Oliver Davies 5ed273040f Fix phpcs error
Order imports alphabetically.
2024-08-10 10:08:39 +01:00
Oliver Davies 61828669fd Remove run.local 2024-08-10 02:47:26 +01:00
Oliver Davies e526a47389 Add missing build configuration files 2024-07-31 20:47:45 +01:00
Oliver Davies 8d1a3b2d91 Update Drupal to 10.3.1 2024-07-31 20:45:39 +01:00
Oliver Davies 0a2947d521 Delete TODO.md 2024-07-31 20:36:16 +01:00
Oliver Davies a47c71b3ad Replace build.yaml with build-configs.yaml 2024-07-31 20:24:00 +01:00
Oliver Davies bcb2ec9131 Update build configuration files 2024-07-31 01:22:00 +01:00
Oliver Davies 064df3c33e Update build configuration files 2024-07-20 13:57:32 +01:00
Oliver Davies 57ea016dcb Update build configuration files 2024-07-17 20:17:41 +01:00
Oliver Davies a3947f3b65 Update build configuration files 2024-05-11 00:00:51 +02:00
Oliver Davies 13945dcaec Update build configuration files 2024-05-10 23:55:32 +02:00
Oliver Davies e917e41d01 Add architectural tests with PHPat 2024-02-09 09:40:53 +00:00
Oliver Davies df04ac0097 Update .gitignore 2024-02-09 07:06:03 +00:00
Oliver Davies 4ecd54844b Use an inclusive .gitignore file 2024-02-09 07:05:22 +00:00
Oliver Davies 3fecd35d1c Rename example to atdc 2024-02-09 07:05:22 +00:00
Oliver Davies db36e7a950 Update build configuration files 2024-02-09 07:05:22 +00:00
Oliver Davies 4c1c13e0e5 Use Build Configs for configuration files 2024-02-09 07:05:22 +00:00
Oliver Davies 568451806e Mock loadByProperties, return mock nodes, add
...assertions
2024-02-09 07:05:22 +00:00
Oliver Davies bc34a96187 Mock loadByProperties, return mock nodes, add
...assertions
2024-02-09 07:05:22 +00:00
Oliver Davies 09f7f528b9 Mock nodeStorage
> TypeError: uasort(): Argument #1 ($array) must be of type array, null given
2024-02-09 07:05:22 +00:00
Oliver Davies 0c162ed08e Try to load posts
> Error: Call to a member function loadByProperties() on null
2024-02-09 07:05:22 +00:00
Oliver Davies 6e00df9ccc Mock EntityTypeManager
> OK, but incomplete, skipped, or risky tests!
> Tests: 1, Assertions: 0, Risky: 1.
2024-02-09 07:05:22 +00:00
Oliver Davies bad5ba5905 Inject a new instance of EntityTypeManager
> ArgumentCountError: Too few arguments to function Drupal\Core\Entity\EntityTypeManager::__construct(), 0 passed in /home/opdavies/Code/github.com/opdavies/atdc/web/modules/custom/example/tests/src/Unit/PostNodeRepositoryUnitTest.php on line 17 and exactly 6 expected
2024-02-09 07:05:22 +00:00
Oliver Davies c54b3efa93 Add PostNodeRepositoryUnitTest
> ArgumentCountError: Too few arguments to function Drupal\example\Repository\PostNodeRepository::__construct(), 0 passed in /home/opdavies/Code/github.com/opdavies/atdc

/web/modules/custom/example/tests/src/Unit/PostNodeRepositoryUnitTest.php on line 15 and exactly 1 expected
2024-02-09 07:05:22 +00:00
Oliver Davies 01289d8711 Add lesson 9 2024-02-09 07:05:22 +00:00
Oliver Davies 2daeca7f8e Throw an Exception if the bundle type is incorrect 2024-01-20 21:02:45 +00:00
Oliver Davies 9f175475c5 Add a test the Exception is thrown 2024-01-20 21:02:28 +00:00
Oliver Davies 196b1f1517 Test node bundle 2024-01-20 21:02:28 +00:00
Oliver Davies e09fdbe5d0 Add expected method result 2024-01-20 21:02:28 +00:00
Oliver Davies 3bede8428f Add an assertion for the bundle type
> Failed asserting that null is identical to 'post'.
2024-01-20 21:02:16 +00:00
Oliver Davies 89a6f933ec Use a mock node 2024-01-20 21:02:16 +00:00
Oliver Davies e0c59ee91a Add a failing unit test
> Drupal\Core\DependencyInjection\ContainerNotInitializedException: \Drupal::$container is not initialized yet. \Drupal::setContainer() must be called with a real container.
2024-01-20 21:02:09 +00:00
Oliver Davies 58f32fdaf4 Add PHPStan configuration 2024-01-18 16:13:13 +00:00
Oliver Davies 1977b567dc Extract a custom assertion 2024-01-18 16:13:13 +00:00
Oliver Davies 35dcb50798 Assert all tags have the correct bundle 2024-01-18 16:13:13 +00:00
Oliver Davies 2a57ff5983 Assert tag names are correct 2024-01-18 16:13:13 +00:00
Oliver Davies d0b591d57a Save tags to the post 2024-01-18 16:13:13 +00:00
Oliver Davies 81bc39b5c2 Install taxonomy_term entity data 2024-01-18 16:13:13 +00:00
Oliver Davies edbbad9a01 Add setTags
> Drupal\Core\Entity\EntityStorageException: SQLSTATE[HY000]: General error: 1 no such table: t
est93789242.taxonomy_term_data: INSERT INTO "test93789242"."taxonomy_term_data" ("revision_id", "v
id", "uuid", "langcode") VALUES (?, ?, ?, ?); Array
2024-01-18 16:13:11 +00:00
Oliver Davies 19f6f0287a Add tags to the post with PostBuilder
> Error: Call to undefined method Drupal\example\Builder\PostBuilder::setTags()
2024-01-18 13:15:55 +00:00
Oliver Davies 22d61485fd Add tag count assertion
> Failed asserting that actual size 0 matches expected size 3.
2024-01-18 13:14:26 +00:00
Oliver Davies a6d9e9a524 Add post node type configuration
> OK (3 tests, 32 assertions)
2024-01-18 12:13:36 +00:00
Oliver Davies b16833c7b5 Enable taxonomy module
> Exception: Exception when installing config for module example_test, message was: Missing bun
dle entity, entity type node_type, entity id post.
2024-01-18 12:10:13 +00:00
Oliver Davies 26515a9517 Install example_test configuration
> Exception: Exception when installing config for module example_test, message was: Field 'field_tags' on entity type 'node' references a target entity type 'taxonomy_term' which does not exist.
2024-01-18 12:08:02 +00:00
Oliver Davies 5845e37be6 Enable example_test 2024-01-18 12:08:02 +00:00
Oliver Davies da5b7407d0 Add example_test module with field_tags configuration 2024-01-18 12:08:00 +00:00
Oliver Davies 899b63ee1b Add Drush as a dependency 2024-01-18 12:02:11 +00:00
Oliver Davies 380d2c5cfe Add tags test
InvalidArgumentException: Field field_tags is unknown.
2024-01-18 09:35:06 +00:00
Oliver Davies ed7f02cc9e Add unpublished post test 2024-01-18 07:39:28 +00:00