2024-05-09 13:57:56 +01:00
|
|
|
..
|
|
|
|
This file used a mixture of `plain` and `php` languages for code blocks so that `hl_lines` display correctly.
|
|
|
|
|
2023-10-17 10:36:46 +02:00
|
|
|
.. page:: titlePage
|
|
|
|
|
|
|
|
.. class:: centredtitle
|
|
|
|
|
2024-05-09 13:57:56 +01:00
|
|
|
Building a blog module
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
TextAnnotation "Shortened and simplified example."
|
|
|
|
TextAnnotation "I'd use Views for this in a real situation."
|
|
|
|
|
|
|
|
.. page:: standardPage
|
|
|
|
|
|
|
|
Acceptance criteria
|
|
|
|
===================
|
|
|
|
|
|
|
|
- As a site visitor
|
|
|
|
- I want to see a list of published articles at ``/blog``
|
|
|
|
- Ordered by post date, most recent first
|
|
|
|
|
|
|
|
Tasks
|
|
|
|
=====
|
|
|
|
|
|
|
|
- Ensure the blog page exists
|
|
|
|
- Ensure only published articles are shown
|
|
|
|
- Ensure the articles are shown in the correct order
|
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. Creating the test class.
|
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-09 13:57:56 +01:00
|
|
|
:include: code/2.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. code-block:: php
|
|
|
|
:include: code/2.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:hl_lines: 1,2,3
|
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. code-block:: php
|
|
|
|
:include: code/2.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:hl_lines: 5,6,7
|
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. code-block:: php
|
|
|
|
:include: code/2.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:hl_lines: 9,10,11
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. Adding the first test.
|
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/3.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:end-before: // end test
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. code-block:: php
|
|
|
|
:include: code/3.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 3,4,8
|
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. code-block:: php
|
|
|
|
:include: code/3.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 5
|
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. code-block:: php
|
|
|
|
:include: code/3.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 7
|
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: plain
|
2024-05-09 13:57:56 +01:00
|
|
|
:include: code/3.txt
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
|
|
|
|
|
|
|
.. code-block:: php
|
|
|
|
:include: code/3.txt
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
|
|
|
:hl_lines: 1,5
|
|
|
|
|
|
|
|
.. code-block:: php
|
|
|
|
:include: code/3.txt
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
|
|
|
:hl_lines: 7
|
|
|
|
|
|
|
|
.. code-block:: php
|
|
|
|
:include: code/3.txt
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
|
|
|
:hl_lines: 8,9
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/3.txt
|
|
|
|
:linenos:
|
|
|
|
:start-after: // start routing
|
|
|
|
:end-before: // end routing
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/3.txt
|
|
|
|
:linenos:
|
|
|
|
:start-after: // start routing
|
|
|
|
:end-before: // end routing
|
|
|
|
:hl_lines: 4,6
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
TextAnnotation "This controller doesn't exist yet, but the test will tell us that."
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-09 13:57:56 +01:00
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/3.txt
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
|
|
|
:hl_lines: 7,8,9
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
TextAnnotation "Same result as the module isn't enabled."
|
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/4.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:end-before: // output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/4.txt
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-09 13:57:56 +01:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
TextAnnotation "The `access content` permission isn't available."
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. Enable the node module.
|
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/5.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:end-before: // end code
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-09 13:57:56 +01:00
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/5.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-09 13:57:56 +01:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
TextAnnotation "The error has changed. This is good."
|
|
|
|
TextAnnotation "The controller we specified doesn't exist."
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. Create the Controller.
|
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/6.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/6.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 1,2,3
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/6.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 7,13
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/6.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 9,10,11
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/6.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/7.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
2024-05-09 13:57:56 +01:00
|
|
|
TextAnnotation "Adding more assertions."
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. code-block:: php
|
|
|
|
:include: code/7.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 5,6
|
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
TextAnnotation "Refactor the original assertion."
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. code-block:: php
|
|
|
|
:include: code/7.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 8,9
|
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/7.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/7.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 3,7
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/7.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 10,11,12
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/7.txt
|
|
|
|
:start-after: // start output2
|
|
|
|
:end-before: // end output2
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/8.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/8.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 1,2,3,4,5,6,7,15
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/8.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 9,10,14
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/8.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 11
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/8.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 13
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/8.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/8.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/9.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/9.txt
|
|
|
|
:linenos:
|
|
|
|
:start-after: // start services
|
|
|
|
:end-before: // end services
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/9.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/10.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 5,6,7
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/10.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/11.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code 1
|
|
|
|
:end-before: // end code 1
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/11.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code 1
|
|
|
|
:end-before: // end code 1
|
|
|
|
:hl_lines: 10,11,12
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/11.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code 1
|
|
|
|
:end-before: // end code 1
|
|
|
|
:hl_lines: 8,13
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/11.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code 2
|
|
|
|
:end-before: // end code 2
|
|
|
|
:hl_lines: 1,3
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/11.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code 2
|
|
|
|
:end-before: // end code 2
|
|
|
|
:hl_lines: 2
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/12.txt
|
|
|
|
:linenos:
|
|
|
|
:start-after: // start services1
|
|
|
|
:end-before: // end services1
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/12.txt
|
|
|
|
:linenos:
|
|
|
|
:start-after: // start services2
|
|
|
|
:end-before: // end services2
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
TextAnnotation "Declare the Repository as a service."
|
|
|
|
TextAnnotation "Autowire or declare dependencies explicitly."
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/12.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/13.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/13.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/14.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 1
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/14.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 5
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/14.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/15.txt
|
|
|
|
:linenos:
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
|
|
|
:startinline: true
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
TextAnnotation "We know we're getting a node, but are we getting the correct node?"
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/15.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 1,2,3,4
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
TextAnnotation "Create a node with a specific title."
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/15.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:end-before: // end test
|
|
|
|
:start-after: // start test
|
|
|
|
:hl_lines: 10,11
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/15.txt
|
|
|
|
:startinline: true
|
|
|
|
:linenos:
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 13,14,15
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
TextAnnotation "Ensure the node is an article and has the correct title."
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. Published or unpublished nodes.
|
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/16.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/16.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 2,4,6
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/16.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 3,5
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-09 13:57:56 +01:00
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/16.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 12
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
TextAnnotation "We should only have three published articles."
|
|
|
|
PageBreak
|
|
|
|
|
2023-10-17 10:36:46 +02:00
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/16.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/17.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/17.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-09 13:57:56 +01:00
|
|
|
.. Ensure articles are ordered correctly.
|
|
|
|
|
2023-10-17 10:36:46 +02:00
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/18.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/18.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 3,5,7,9,11
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/18.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start test
|
|
|
|
:end-before: // end test
|
|
|
|
:hl_lines: 16
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/18.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/19.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/19.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 2,3,4
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2024-05-09 13:57:56 +01:00
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/19.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 6,7
|
2023-10-17 10:36:46 +02:00
|
|
|
|
2024-05-09 13:57:56 +01:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
TextAnnotation "Spaceship operator!"
|
|
|
|
PageBreak
|
|
|
|
|
|
|
|
.. code-block:: php
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/19.txt
|
|
|
|
:linenos:
|
|
|
|
:startinline: true
|
|
|
|
:start-after: // start code
|
|
|
|
:end-before: // end code
|
|
|
|
:hl_lines: 9
|
2024-05-09 13:57:56 +01:00
|
|
|
|
2024-05-10 22:37:50 +02:00
|
|
|
.. raw:: pdf
|
|
|
|
|
|
|
|
PageBreak
|
2023-10-17 10:36:46 +02:00
|
|
|
|
|
|
|
.. code-block:: plain
|
2024-05-10 22:40:24 +02:00
|
|
|
:include: code/19.txt
|
|
|
|
:start-after: // start output
|
|
|
|
:end-before: // end output
|