Skip to content
Latchkey

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.

PHPUnit
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

  1. Find the test that calls markTestIncomplete().
  2. Implement the missing assertions, or delete the placeholder.
  3. Re-run so the suite has no incomplete markers.
tests/InvoiceTest.php
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.

Terminal
vendor/bin/phpunit --fail-on-incomplete --fail-on-risky

How to prevent it

  • Resolve markTestIncomplete placeholders before merging.
  • Use --fail-on-incomplete in CI so they cannot pass silently.
  • Keep stubbed tests out of the suite until they assert something.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →