PHPUnit "Incomplete" tests reported in CI
PHPUnit marked one or more tests as incomplete because the test called markTestIncomplete(). The suite can still exit OK, so an incomplete test silently leaves a code path untested unless you enforce stricter handling.
What this error means
PHPUnit output shows "I" markers and a summary line "OK, but incomplete, skipped, or risky tests! ... Incomplete: N." The job passes, but the marked tests did not actually verify anything.
OK, but incomplete, skipped, or risky tests!
Tests: 12, Assertions: 30, Incomplete: 1.Common causes
A test calls markTestIncomplete
The test body invokes $this->markTestIncomplete(...), telling PHPUnit the test is unfinished, so it is reported as incomplete rather than passing.
Placeholder tests left in the suite
Stubbed tests that were never finished remain in the suite and report as incomplete on every run.
How to fix it
Finish or remove the incomplete test
- Find the test that calls
markTestIncomplete(). - Implement the missing assertions, or delete the placeholder.
- Re-run so the suite has no incomplete markers.
public function testCreatesInvoice(): void
{
$invoice = $this->service->create($data);
$this->assertSame('paid', $invoice->status);
}Fail the build on incomplete tests
Treat incomplete and risky tests as failures so they cannot hide behind a green run.
vendor/bin/phpunit --fail-on-incomplete --fail-on-riskyHow to prevent it
- Resolve
markTestIncompleteplaceholders before merging. - Use
--fail-on-incompletein CI so they cannot pass silently. - Keep stubbed tests out of the suite until they assert something.