Pest Testing Framework

Writing Community

Skill notes

Datasets

Use datasets to run the same test with different inputs:

HTTP Requests

Pest provides methods to test HTTP endpoints by simulating requests and asserting on responses.

Authenticated Requests

Use actingAs() to make requests as a specific user:

Best Practices for HTTP Testing

Test Your Logic, Not the Framework: Focus on custom validation, rendering logic, or business rules rather than testing if Craft CMS works Use Meaningful Assertions: Assert on the actual behavior that matters to your application Clean URLs: Use relative URLs starting with / for consistency Chain Assertions: Take advantage of fluent chaining for readable tests Example of a well-focused HTTP test:

Rendering Templates Directly

Use ->renderTemplate() to render Twig templates directly without the overhead of a full HTTP request. This is faster and more focused than ->get() when you only need to test template output.

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
Writing
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
88 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@markhuot · no license declared
Token usage
Moderate
Setup complexity
Guided setup
External API key
Not required
Operating systems
Unspecified (assume cross-platform)
Runtime requirements
No explicit requirements detected
Detected file/system behavior
  • Read-only
  • Write / modify
  • Shell exec
Network behavior
External requests
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.

Output preview pest-testing-framework.preview
# Verbose Output

# Show more details about test execution
php ./vendor/bin/pest -v
php ./vendor/bin/pest -vv
php ./vendor/bin/pest -vvv

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.