-
Notifications
You must be signed in to change notification settings - Fork 468
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
tests failing with phpunit
- fatal error for syntax issues?
#513
Comments
I can't change the tests to run natively in PHPUnit 9 as it'll break older PHP versions that rely on older PHPUnit versions. That's the point of simple-phpunit. I'd suggest using an older version of PHPUnit |
That's what simple-phpunit is doing to the phpunit version it's including. Return types were only introduced in PHP 7, and this project still supports 5.3+. |
From what I understood of the URL above, it permits to add the missing But maybe I'm wrong. Unfortunately, on the debian build systems, it is not possible to select a specific phpunit version (other than the ones shipped in the distrib) |
I believe it's the other way around. It removes the void return type from the PHPUnit code itself. |
Do you by chance know of a workaround so that I could still run the tests with
In debian the phpunit bridge for symfony is available. It is just the the |
The listener there is only for deprecation notices, not any help here. The simple-phpunit script if part of the phpunit-bridge, so you should have it somewhere with that package: https://github.com/symfony/phpunit-bridge/tree/5.4/bin |
Ok for the listener. Concerning the script, Debian doesn't ship it in its package and won't ship it. It is not possible to get it another way (eg from the internet) on the build systems because they don't have internet access. Moreover the script requires internet access to download the composer dependencies. So I'm stuck. Probably I'll have to patch your tests manually then for debian only. |
Could the packager script use regex/sed to add the return type for the tests? I assume the actual package won't include the test files. |
I can use sed to create a patch but in the end it has to be in the form of a patch. Indeed the tests are unlikely to be shipped in the resultant binary package. They are useful to test the package is functional. |
A patch would work fine. I'd be happy to include it within the project too so it's easier to keep it up to date. I don't imagine those files will change until I drop PHP 5 support anyway. |
What would you do with it if won't run on php5? |
Would your packaged version run on PHP 5? If so, how are you running phpunit? I can just put the patch in as tests/phpunit8-compatibility.patch (or similar) |
Packages are uploaded to "unstable" (which I believe has php8.1) where I guess they are built, then after some time they enter "testing", which at some time becomes "stable". Packages can be backported to current Debian stable which runs php7.4 IIRC. So it is unlikely the package will be build on a build system running php5.
As for the patch, the Debian build scripts (roughly) applies them, builds the package and then unapplies them. So in think the Debian package will anyway have to maintain its own copy of the patch to be able to apply/unapply automatically. You may find the patch here: |
Okay, I think your approach of including that patch in the debian repo (especially as you have others) makes sense. |
It would be much preferable if the logic could be changed upstream so that no patches are needed in Debian package, but well, I understand it can not always be done. |
NullPointerException is being fixed now (#515). I also don't think you need https://salsa.debian.org/php-team/pear/php-giggsey-libphonenumber/-/blob/debian/latest/debian/patches/02-debian-test.patch if you are using normal phpunit again |
Yes, you're right. Thanks! |
Happy for this to be closed now? |
The package could not be submitted for approval yet, so we can't know what 'debian ftp masters' would think about the patch. Nevertheless #513 (comment) is still relevant. |
Hello,
I know one should use
./phpunit
(hencesimple-phpunit
) for the tests, but actually I don't have the possibility to use it, so I run the tests by executingphpunit
. I can't usesimple-phpunit
because that script it is not packaged in Debian and it is likely it won't be. I need to run the test because I'm trying to package your lib into an official Debian package, and we are strongly advised to run upstream's test suite in the package.Running
phpunit
returns this errorWould you fix your tests so that they also work with phpunit?
The text was updated successfully, but these errors were encountered: