wp-cli / php-cli-tools

A collection of tools to help with PHP command line utilities
MIT License
676 stars 118 forks source link

Fix unit tests #172

Closed swissspidy closed 6 months ago

swissspidy commented 6 months ago

Trying to fix tests after https://github.com/wp-cli/wp-cli-tests/pull/206

I realized we were not actually running tests against PHP 5.3, only 5.6+, so I figured we can just bump the requirement while at it.

To-do:

thelovekesh commented 6 months ago

@swissspidy It seems like on local, tests autoloading has no effect. Tests are running on local even when I disable this line

https://github.com/wp-cli/php-cli-tools/blob/6507ba299f2e918f47c29857ebfbf5f3254131e3/tests/bootstrap.php#L22

thelovekesh commented 6 months ago

Can I send some tests commits to this PR?

swissspidy commented 6 months ago

Yes I noticed that too, but no idea why.

And the error message on CI don't seem to make sense either

PHP Warning:  Uncaught require(/home/runner/work/php-cli-tools/php-cli-tools/lib/cli/Table/Ascii.php): failed to open stream: No such file or directory

/home/runner/work/php-cli-tools/php-cli-tools/tests/bootstrap.php:19

/lib/cli/Table/Ascii.php does exist

thelovekesh commented 6 months ago

Error message have Table in the path while the directory name is table.

thelovekesh commented 6 months ago
├── table
│   ├── Ascii.php
│   ├── Renderer.php
│   └── Tabular.php
swissspidy commented 6 months ago

That was it! Thanks @thelovekesh!

thelovekesh commented 6 months ago

Still a mystery to me, why it was not reproducible on my local 🤔. I guess it has something to do with tests custom autoloader.

swissspidy commented 6 months ago

Case insensitive filesystem I suppose