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

1.0.2 fails with phpunit <7 when installed with "--from-composer" #411

Open
tenzap opened this issue Feb 13, 2024 · 2 comments
Open

1.0.2 fails with phpunit <7 when installed with "--from-composer" #411

tenzap opened this issue Feb 13, 2024 · 2 comments

Comments

@tenzap
Copy link

tenzap commented Feb 13, 2024

I think there is a small issue in 1.0.2 when using phpunit 5 or 6. With phpunit7 there is no problem.
version 1.0.2 is the last one supporting php 5.6

The cause is the presence of <exclude>./_ci_phpunit_test/</exclude> in phpunit.xml

If there is this line and if we installed with --from-composer , phpunit will fail with the error below.

This is because the dir application/tests/_ci_phpunit_test/ doesn't exist in that case. Probably it is more of a phpunit bug, but I'm not sure this would ever be fixed there.

Error:

An uncaught Exception was encountered

Type:        ErrorException
Message:     strpos(): Empty needle
Filename:    vendor/phpunit/php-file-iterator/src/Iterator.php
Line Number: 104

Backtrace:
        File: vendor/phpunit/php-file-iterator/src/Iterator.php
        Line: 104
        Function: strpos

        File: vendor/phpunit/php-file-iterator/src/Iterator.php
        Line: 91
        Function: acceptPath

        File: vendor/phpunit/php-file-iterator/src/Factory.php
        Line: 58
        Function: append

        File: vendor/phpunit/php-file-iterator/src/Facade.php
        Line: 37
        Function: getFileIterator

        File: vendor/phpunit/phpunit/src/Util/Configuration.php
        Line: 941
        Function: getFilesAsArray

        File: vendor/phpunit/phpunit/src/Util/Configuration.php
        Line: 843
        Function: getTestSuite

        File: vendor/phpunit/phpunit/src/TextUI/Command.php
        Line: 784
        Function: getTestSuiteConfiguration

        File: vendor/phpunit/phpunit/src/TextUI/Command.php
        Line: 127
        Function: handleArguments

        File: vendor/phpunit/phpunit/src/TextUI/Command.php
        Line: 116
        Function: run

        File: phpvfscomposer://vendor/phpunit/phpunit/phpunit
        Line: 51
        Function: main

        File: vendor/bin/phpunit
        Line: 118
        Function: include

Workaround is:

  • to create the dir, but that's not a good solution, such an empty dir wouldn't appear in git (unless putting an empty file in it)
  • or not put the <exclude>./_ci_phpunit_test/</exclude> line in phpunit.xml when installed with '--from-composer'
@kenjis
Copy link
Owner

kenjis commented Feb 13, 2024

Thank you for reporting.

But unfortunately install.php is not perfect. See #373
I recommend you remove the line in phpunit.xml manually.

Also, CI3 is almost no longer maintained. I don't recommend to use.

@tenzap
Copy link
Author

tenzap commented Feb 13, 2024

Thanks.

Also, CI3 is almost no longer maintained. I don't recommend to use.

Sad outcome for open-source projects in maintenance mode with low manpower. Hopefully minimal maintenance will still be provided.

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

No branches or pull requests

2 participants