• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

valkyrjaio / valkyrja-php / 30415926697
100%

Build:
DEFAULT BRANCH: 26.x
Ran 29 Jul 2026 02:08AM UTC
Jobs 1
Files 1138
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Jul 2026 02:06AM UTC coverage: 100.0%. Remained the same
30415926697

push

github

web-flow
[Http] Add an overridable SAPI seam to UploadedFileFactory (#946)

# Description

`UploadedFileFactory::isValidSapiEnvironmentForUploads()` reads
`PHP_SAPI` and
returns `! str_starts_with($sapi, 'cli') && ! str_starts_with($sapi,
'phpdbg')`.
Under PHPUnit `PHP_SAPI` is always `cli`, so the first operand is always
false
and the second operand is never evaluated — one branch of that condition
is
unreachable by any test, and `PHP_SAPI` cannot be changed at runtime.

The remedy is the seam pattern already used for irreducible native calls
elsewhere in the framework (see `ResponseSendRecorderFixture` and the
entry
workers): the SAPI lookup moves into a small overridable
`protected static function getSapi()`, called through `static::` so a
subclass
can drive it. A `Tests\Fixtures` subclass overrides it to report `cli`,
`cli-server`, `phpdbg`, `apache2handler` and `fpm-fcgi`, which exercises
both
operands and both outcomes; the pre-existing real-call test
(`testIsValidSapiEnvironmentForUploadsReturnsFalseUnderCli`) still runs
the seam
body itself, so the `PHP_SAPI` read is covered too.

Public behavior is unchanged:
`UploadedFileFactory::isValidSapiEnvironmentForUploads()`
still resolves `getSapi()` to the real `PHP_SAPI`.

Verified per-shard (never merged — Xdebug builds a different branch map
for a
function depending on whether it ran, so merged shard data invents
branches):

```
composer phpunit-path-coverage-shard Http
```

**`src/Valkyrja/Http/Message/File/Factory/UploadedFileFactory.php`:
branches
25/26 → 27/27, paths 10/18 → 12/19.** (The denominator grows because the
seam
adds a method.)

## Types of changes

- [x] Improvement _(non-breaking change which improves code)_
- [ ] Bug fix _(non-breaking change which fixes an issue)_
- [ ] New feature _(non-breaking change which adds functionality)_
- [ ] Deprecation _(breaking change which removes functionality)_
- [ ] Breaking change _(fix or feature that would cause existing
functionality to change)_
- ... (continued)

3 of 0 new or added lines in 0 files covered. (NaN%)

12595 of 12595 relevant lines covered (100.0%)

23.76 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30415926697.1 29 Jul 2026 02:08AM UTC 1138
100.0
GitHub Action Run
Source Files on build 30415926697
  • Tree
  • List 1138
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30415926697
  • b03f01a4 on github
  • Prev Build on 26.x (#30415744196)
  • Next Build on 26.x (#30416416065)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc