Skip to content

Useless error message when depending on test that does not exist #3517

@sebastianbergmann

Description

@sebastianbergmann

Reproducting example

<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;

final class Test extends TestCase
{
    /**
     * @depends doesNotExist
     */
    public function testOne(): void
    {
    }
}

Actual output

$ ./phpunit --verbose Test
PHPUnit 8.0.1 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.3.2 with Xdebug 2.7.0rc1

S                                                                   1 / 1 (100%)

Time: 30 ms, Memory: 4.00MB

There was 1 skipped test:

1) Test::testOne
This test depends on "Test::doesNotExist" to pass.

OK, but incomplete, skipped, or risky tests!
Tests: 1, Assertions: 0, Skipped: 1.

Expected output

$ ./phpunit --verbose Test
PHPUnit 8.0.1 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.3.2 with Xdebug 2.7.0rc1

W                                                                   1 / 1 (100%)

Time: 30 ms, Memory: 4.00MB

There was 1 warning:

1) Test::testOne
This test depends on "Test::doesNotExist" which does not exist

WARNINGS!
Tests: 1, Assertions: 0, Warnings: 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementA new idea that should be implemented

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions