Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

quality.testing

Avoid raw curl calls in PHP unit tests

curl_exec in tests should target doubles or local fixtures.

#Metadata

Rule ID
php.testing.curl-in-unit-test
Severity
medium
Confidence
0.62
Languages
php
Presets
recommended, strict
Stability
experimental
Applies to
block
Tags
php, rules-catalog, testing

#Why it matters

Live HTTP couples CI to the network.

#Remediation

Wrap HTTP behind an injectable client and replace curl usage with doubles in unit tests.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/php/php.testing.curl-in-unit-test.rule.yaml.