Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:tests:commentapidtotest

This is an old revision of the document!


tests/api/unit/dto/CommentApiDtoTest.php

Source: tests/api/unit/dto/CommentApiDtoTest.php · 174 lines, ~742 statements · namespace: (global) · `declare(strict_types=1)`: no


CommentApiDto Test

Unit tests for Scriptlog\Dto\Api\CommentApiDto.

The transform() output contract (verified against the implementation in lib/dto/api/CommentApiDto.php) emits: id, post_id, parent_id, author{name, email}, content, status, date. When the source row carries post context (post_title) a nested “post” object is added. CommentApiDto does not emit per-item _links nor a “replies” collection (nested replies are surfaced via the parent_id field).

Includes

^ Mode ^ Target ^ Line ^
| ''require'' | ''require_once __DIR__ . '/../../ApiTestCase.php';'' | 17 |
| ''require'' | ''require_once __DIR__ . '/../../fixtures/ApiDataFixture.php';'' | 18 |

Types declared here


Generated by 'tools/gendoc'.

scriptlog/tests/commentapidtotest.1790413764.txt.gz · Last modified: by admin