Install
$ agentstack add skill-trebormc-drupal-ai-agents-drupal-testing ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Drupal Testing — Orchestrator
This skill coordinates test generation for Drupal 10/11 projects. It analyzes the code under test and delegates to the appropriate specialized skill.
Decision Flow
See the drupal-testing rule for the complete decision tree. Quick summary:
| Code Type | Test Type | Skill | |-----------|-----------|-------| | Pure PHP, no Drupal deps | Unit | Template in drupal-testing rule | | Advanced unit mocking | Unit | drupal-unit-test | | Services, entities, DB, config, plugins, hooks | Kernel | drupal-kernel-test | | UI forms, HTTP permissions, HTML output | Functional | drupal-functional-test | | AJAX, modals, autocompletes, JS | FunctionalJavascript | drupal-functionaljs-test | | E2E flows, acceptance (Behat project) | Behat | drupal-behat-test | | Visual regression, cross-browser, E2E (no Behat) | Playwright | drupal-playwright-test |
Tie-breakers (apply them, do not deliberate): touches any Drupal service or needs >4-5 mocks → Kernel. Assertion about logic/data, not HTML/HTTP → Kernel over Functional. No-JS behavior → never FunctionalJS. behat.yml exists → Behat, else Playwright. Pick ONE type per behavior.
Workflow
- Detect Drupal version — check
core/lib/Drupal.phporcomposer.json - Read the code — understand dependencies and Drupal API usage
- Check existing tests — look at
tests/folder, match existing style - Apply decision tree — use the
drupal-testingrule - Load specialized skill — delegate to the appropriate skill
- Execute and verify — run the test, fix if it fails
Test Execution Commands
Replace MODULE with the module machine name.
STEP 1 — Pick the config form. Run ONCE, then use the matching form for the whole session:
ssh web test -f phpunit.xml && echo "ROOT" || echo "CORE"
# Form ROOT (project phpunit.xml exists — it already sets env vars):
ssh web ./vendor/bin/phpunit $DDEV_DOCROOT/modules/custom/MODULE/tests/src/Unit
ssh web ./vendor/bin/phpunit $DDEV_DOCROOT/modules/custom/MODULE/tests/src/Kernel
ssh web ./vendor/bin/phpunit $DDEV_DOCROOT/modules/custom/MODULE/tests/src/Functional
ssh web ./vendor/bin/phpunit $DDEV_DOCROOT/modules/custom/MODULE/tests/src/FunctionalJavascript
# Form CORE (no project phpunit.xml — Drupal core config + explicit env vars):
ssh web env SIMPLETEST_DB=mysql://db:db@db/db SIMPLETEST_BASE_URL=http://localhost \
./vendor/bin/phpunit -c $DDEV_DOCROOT/core $DDEV_DOCROOT/modules/custom/MODULE/tests/src/Unit
# Single test method (add --filter before the path; works with both forms)
ssh web ./vendor/bin/phpunit --filter testMethodName $DDEV_DOCROOT/modules/custom/MODULE/tests/src/Unit
# Coverage (requires Xdebug; report written to /tmp/coverage in the web container)
ssh web env XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html /tmp/coverage \
$DDEV_DOCROOT/modules/custom/MODULE/tests/src/Unit
# Behat (uses behat.yml, not phpunit.xml)
ssh web ./vendor/bin/behat --config=behat.yml
# Playwright (runs on the HOST — ask the user to run: npx playwright test)
Rules: always pass the test directory as an explicit path; never rely on --testsuite; never use -c core (use -c $DDEV_DOCROOT/core only in Form CORE). If a test fails to start (DB/URL/autoload errors), see the error table in the drupal-testing rule.
Test Directory Structure
$DDEV_DOCROOT/modules/custom/MODULE/
└── tests/
├── src/
│ ├── Unit/ <- drupal-unit-test
│ ├── Kernel/ <- drupal-kernel-test
│ ├── Functional/ <- drupal-functional-test
│ └── FunctionalJavascript/ <- drupal-functionaljs-test
├── modules/
│ └── MODULE_test/ <- Auxiliary test module
└── behat/
└── features/ <- drupal-behat-test
Common Rules (All Test Types)
- Always
declare(strict_types=1);after<?php - Always
@group MODULE_NAME - Always type return as
voidin test methods - Always call
parent::setUp()first insetUp() - Always use
staticdata providers (D10+D11 compatibility) - Never use
sleep()— use waits in JS tests - Never use
withConsecutive()— removed in PHPUnit 10 - Prefer
assertSame()overassertEquals() - One test per behavior, not per method
- Use PHPDoc annotations, not PHP 8 attributes (D10 compatibility)
Related Skills
- drupal-unit-test — Advanced mock patterns, service mocking, reflection DI
- drupal-kernel-test — Services, entities, DB, config, plugins, hooks
- drupal-functional-test — Forms, permissions, HTML output
- drupal-functionaljs-test — AJAX, modals, autocompletes
- drupal-behat-test — BDD, acceptance testing, Gherkin
- drupal-playwright-test — Visual regression, cross-browser, E2E
- quality-checks — Code quality validation after writing tests
- drupal-debugging — Test debugging and troubleshooting
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: trebormc
- Source: trebormc/drupal-ai-agents
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.