Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sebastianbergmann opened this issue Feb 7, 2019 · 3 comments
Closed

Comments

@sebastianbergmann
Copy link
Owner

@sebastianbergmann sebastianbergmann commented Feb 7, 2019

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.
@sebastianbergmann
Copy link
Owner Author

@sebastianbergmann sebastianbergmann commented Feb 7, 2019

@epdenouden Do you think that this can be implemented?

Loading

@epdenouden
Copy link
Collaborator

@epdenouden epdenouden commented Feb 7, 2019

@sebastianbergmann Yes and I can build it if you'd like. I've recently done work in that area, it's just one extra check near the @depends handling. Bubbling a nice error to the surface might take a bit more work, I'll check it out.

Loading

@sebastianbergmann
Copy link
Owner Author

@sebastianbergmann sebastianbergmann commented Feb 7, 2019

Would be great if you could implement this.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants