Commit graph

53 commits

Author SHA1 Message Date
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
Oliver Davies 2b3f98c43d Add published post test 2024-01-18 07:39:28 +00:00
Oliver Davies e6caccc1b4 Add empty test 2024-01-18 07:39:28 +00:00
Oliver Davies 99d4311eb6 Only load post nodes 2024-01-17 11:03:26 +00:00
Oliver Davies 3eb71026c1 Add only post node test 2024-01-17 11:01:55 +00:00
Oliver Davies 7714b20d3c Only load published nodes 2024-01-17 10:58:35 +00:00
Oliver Davies 529eb1458e Update Builder logic to set the node status 2024-01-17 10:58:35 +00:00
Oliver Davies c2e8d312c8 Add isNotPublished() method 2024-01-17 10:58:35 +00:00
Oliver Davies 7d79a2ea14 Fix integrity constraint violation error 2024-01-17 10:58:35 +00:00
Oliver Davies 86b5c18f8d Add isPublished() method 2024-01-17 10:58:35 +00:00
Oliver Davies 8c3b9438c7 Add published nodes test 2024-01-17 10:58:14 +00:00
Oliver Davies 71e70a56c5 Adding return types 2024-01-17 10:48:33 +00:00
Oliver Davies de5ffc1aee Fix bug in lesson 6 2024-01-17 10:39:39 +00:00
Oliver Davies 812ab02bfa Add a run file with a consistent test task 2024-01-16 15:56:15 +00:00
Oliver Davies 9be750fdf7 Add paratest for running tests in parallel 2024-01-16 09:43:22 +00:00
Oliver Davies 2b2a9facea Add groups to lesson tests 2024-01-15 10:29:12 +00:00
Oliver Davies acaabb14ca Fix .tmux script 2024-01-15 10:09:50 +00:00
Oliver Davies 3db62f83b9 Extract a custom assertion method 2024-01-15 08:51:12 +00:00
Oliver Davies c687deaf5c Refactor to use a PostBuilder 2024-01-15 08:51:12 +00:00
Oliver Davies f7487a6bbe Update .tmux script
- Open nvim without `+GoToFile`
- Run PHPUnit in watch mode
2024-01-15 08:51:12 +00:00
Oliver Davies ea2c228806 Update port number
Prevents collisions with other running projects, such as my personal
website that uses Sculpin and also port 8000 by default.
2024-01-15 08:51:12 +00:00
Oliver Davies 75b17fd565 Add lesson 4
- Add initial `PostNodeRepository`
- Move logic to Repository
- Inject `EntityTypeManagerInterface`
- Add `PostNodeRepositoryTest`
- Add failing test method
- Failing test: non-existent service
- The "node" entity type does not exist.
- Create posts
- Add assertions based on the `created` date
- Sort nodes before returning them
- Return values to reset array keys
2024-01-14 09:37:02 +00:00
Oliver Davies 5121502d7f Fix spacing 2024-01-14 09:37:02 +00:00
Oliver Davies 8196483944 Configure PHPCS 2024-01-14 09:37:02 +00:00
Oliver Davies 99204d78df Add lesson 3
- Add failing blog page test.
- Add custom routing, need to create Controller.
- Add BlogPageController.
- Test posts are visible.
2024-01-09 01:18:45 +00:00
Oliver Davies e931656b68 Add TODO.md 2024-01-04 01:43:49 +00:00
Oliver Davies 07f698e6c0 Content test 2024-01-04 01:41:41 +00:00
Oliver Davies 9abcf39fe7 Authenticated user admin page test 2024-01-04 01:41:41 +00:00
Oliver Davies 44adee585b Test Drupal pages 2024-01-04 01:36:20 +00:00
Oliver Davies 11391c2b86 Add initial test 2024-01-04 01:36:19 +00:00
Oliver Davies ebd4e202c2 Configure PHPUnit 2023-12-26 01:33:22 +00:00
Oliver Davies fafddca637 Add drupal/core-dev 2023-12-25 21:56:42 +00:00