Skip to content

Set exclude var to "/" if its an empty string after removing the basepath #27

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

Closed
wants to merge 1 commit into from

Conversation

IceShack
Copy link

With following testsuites configuration, the php-file-iterator returned a PHP warning
To prevent this warning I suggest that if the $_exclude var ist empty after removing the basepath it should be set to '/'.

Testsuite configuration:

<testsuites>
    <testsuite name="some">
        <directory>../src/Acme/SomeBundle/Tests</directory>
    </testsuite>
    <testsuite name="other">
        <directory>../src/*/*Bundle/Tests</directory>
        <directory>../src/*/*/*Bundle/Tests</directory>
        <exclude>../src/Acme/SomeBundle/Tests</exclude>
    </testsuite>
</testsuites>

PHP-Warning:

PHP Warning:  strpos(): Empty needle in /some-dir/vendor/phpunit/php-file-iterator/src/Iterator.php on line 104

@IceShack
Copy link
Author

@sebastianbergmann, any opinions?

@hugues-m
Copy link

Hi @IceShack , i'm having the same issue, have you found another workaround for this problem that doesn't involve code modification in phpunit libraries ?

@IceShack
Copy link
Author

Unfortunately not, I just replaced the wildcards with the explicit directories

@hugues-m
Copy link

Ok, same here... Thanks !

@grzeg1
Copy link

grzeg1 commented Sep 28, 2016

@sebastianbergmann same issue here, we need this fix

@grzeg1
Copy link

grzeg1 commented Sep 28, 2016

fail scenario (this PR fixes the problem):

<testsuite name="part1">
       <directory>test/application/[a-m]*</directory>
       <exclude>test/application/model</exclude>
</testsuite>
        <testsuite name="part2">
        <directory>test/application/[n-z]*</directory>
</testsuite>

@cbeyer
Copy link

cbeyer commented Apr 3, 2017

Same problem for me.
@grzeg1 have you tried this ?

<testsuite name="part1">
       <directory>test/application/[a-m]*</directory>
       <exclude>test/application/model*</exclude>
</testsuite>

@sebastianbergmann
Copy link
Owner

Superseded by #32.

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

Successfully merging this pull request may close these issues.

5 participants