Skip to content

Emit error when (configured) test directory does not exist #4493

Closed
@bytestream

Description

@bytestream
Q A
PHPUnit version 8.5.8
PHP version 7.3.21
Installation Method Composer

Summary

--testsuite does not error when directory does not exist.

Current behavior

PHPUnit 8.5.8 by Sebastian Bergmann and contributors.

No tests executed!

How to reproduce

phpunit.xml

<testsuite name="cache">
    <directory>test/cache</directory>
</testsuite>

Create test/Cache - note difference in capitalisation, and run:
./vendor/bin/phpunit --testsuite=cache --stop-on-failure

Expected behavior

phpunit should error:

Suite path test/cache could not be found 

Activity

bytestream

bytestream commented on Oct 25, 2020

@bytestream
Author

See https://github.com/bytestream/phpunit-4493 for minimal repository.

sebastianbergmann

sebastianbergmann commented on Oct 26, 2020

@sebastianbergmann
Owner

This is consistent with what happens when --testsuite is not used.

changed the title [-]testsuite does not error when directory doesn't exist[/-] [+]Emit error when (configured) test directory does not exist[/+] on Oct 26, 2020
bytestream

bytestream commented on Oct 26, 2020

@bytestream
Author

It makes sense to error if an argument is invalid - otherwise it's difficult for people to debug. Paratest for example, throws a configuration exception in this case.

added this to the PHPUnit 9.5 milestone on Oct 27, 2020
bytestream

bytestream commented on Oct 28, 2020

@bytestream
Author

Thanks! 🎉

99 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @sebastianbergmann@bytestream

      Issue actions

        Emit error when (configured) test directory does not exist · Issue #4493 · sebastianbergmann/phpunit