-
Notifications
You must be signed in to change notification settings - Fork 5
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
FIX number of parameters at ArgumentCountError exception #6
Conversation
Looks like the unit tests are failing. I can take a look this evening but if you wanna take a look sooner that'd be cool too! |
So it looks like it's your changes to the unit tests that are causing the failures on GitHub Actions. It's like you made the unit tests compliant with a newer version of PHPUnit without updating the version of PHPUnit required in composer.json. Your changes, otherwise, do look good, and it'd be good for the 1.0 / 2.0 branches to have them as well - just not the unit test changes. I also have a feeling that the unit test changes require a newer version of PHPUnit than the 1.0 branch could even support due to the 1.0 branch working on versions of PHP as low as 5.6. I need to get ready to go into work but if you want to update your PR request to include an update to composer.json that'd be great. If not I'll cherry-pick your commit into the 1.0 branch, undo the unit test changes in a second commit, and then merge those two commits into the 2.0 branch and then merge 2.0 into master. |
I will have a look at the composer.json, but I need some time to do so. Automatic testing on github is new territory for me. I don't know the necessary settings on github. How do you trigger the phpunit in github.... Please give me this time, then I'll try it myself. BR Tom |
I think all you need to do is go to the Settings tab of your repo and enable GitHub Actions from there. The repo, itself, already contains all the necessary config info for that (in the .github subdirectory). https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository talks about this more. In truth it's been a while since I've setup GitHub Actions on a fork. I guess I'll give you until the weekend to try to figure it out? Not trying to rush you or anything but you made a good find and I'm eager to have it in the codebase 😁 Thanks! |
The updated tests run smoothly in my forked repo and I've done it. |
And it's been merged!: Thanks! |
tl;dr
The exception ArgumentCountError gives wrong given parameter length.
The
func_num_args()
used - only returns the number of parameters of the called function and is always 2 in this case.You are probably wondering why I came up with this? My editor shows me an error that the parameters for the
__callStatic()
magic function should always be the amount of 2.I also adapted the test file with phpunit version 11.1.3, expanded it and checked the output with
phpunit --testdox-test testdox.txt --display-skipped
:Now with the patch, which is also attached, we get:
bcmath_patch.txt
Best regards, tkuschel