Add unit and integration test suite #33

Open
opened 2026-05-31 01:18:57 +00:00 by jmiller · 1 comment
Owner

Problem

The extension has zero automated tests. No unit tests, integration tests, or functional tests exist.

Impact

Without tests, regressions can ship silently. Batch generation, CSV import/export, OG tag injection, JSON-LD output, and image resizing are all untested.

Acceptance Criteria

  • PHPUnit configured with phpunit.xml and Joomla test bootstrap
  • Unit tests for ImageHelper::resize(), ImageHelper::validate()
  • Unit tests for JsonLdBuilder::buildArticle(), JsonLdBuilder::toScriptTag()
  • Unit tests for BatchController::extractDescription() and extractImage()
  • Unit tests for CSV import parsing logic
  • Integration test for content plugin save/load round-trip
  • Integration test for system plugin language fallback in loadOgData()
  • CI workflow runs tests on PR
  • Coverage target: 60%+ for helpers, 40%+ overall

Files

  • phpunit.xml (new)
  • tests/Unit/Helper/ImageHelperTest.php
  • tests/Unit/Helper/JsonLdBuilderTest.php
  • tests/Unit/Controller/BatchControllerTest.php
  • tests/Integration/ContentPluginTest.php
  • .mokogitea/workflows/ci-joomla.yml (add test step)
## Problem The extension has zero automated tests. No unit tests, integration tests, or functional tests exist. ## Impact Without tests, regressions can ship silently. Batch generation, CSV import/export, OG tag injection, JSON-LD output, and image resizing are all untested. ## Acceptance Criteria - [ ] PHPUnit configured with `phpunit.xml` and Joomla test bootstrap - [ ] Unit tests for `ImageHelper::resize()`, `ImageHelper::validate()` - [ ] Unit tests for `JsonLdBuilder::buildArticle()`, `JsonLdBuilder::toScriptTag()` - [ ] Unit tests for `BatchController::extractDescription()` and `extractImage()` - [ ] Unit tests for CSV import parsing logic - [ ] Integration test for content plugin save/load round-trip - [ ] Integration test for system plugin language fallback in `loadOgData()` - [ ] CI workflow runs tests on PR - [ ] Coverage target: 60%+ for helpers, 40%+ overall ## Files - `phpunit.xml` (new) - `tests/Unit/Helper/ImageHelperTest.php` - `tests/Unit/Helper/JsonLdBuilderTest.php` - `tests/Unit/Controller/BatchControllerTest.php` - `tests/Integration/ContentPluginTest.php` - `.mokogitea/workflows/ci-joomla.yml` (add test step)
jmiller added the priority: hightestingproduction-readiness labels 2026-05-31 01:18:57 +00:00
Author
Owner

Branch created: feature/33-add-unit-and-integration-test-suite

git fetch origin
git checkout feature/33-add-unit-and-integration-test-suite
Branch created: [`feature/33-add-unit-and-integration-test-suite`](https://git.mokoconsulting.tech/MokoConsulting/MokoJoomOpenGraph/src/branch/feature/33-add-unit-and-integration-test-suite) ```bash git fetch origin git checkout feature/33-add-unit-and-integration-test-suite ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomOpenGraph#33