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

Error executing phpunit. #3909

Closed
1 task done
nelson1995 opened this issue Oct 28, 2023 · 6 comments
Closed
1 task done

Error executing phpunit. #3909

nelson1995 opened this issue Oct 28, 2023 · 6 comments

Comments

@nelson1995
Copy link

PHP_CodeSniffer Bug

I want to contribute to PHP_Codesniffer and I followed the CONTRIBUTING.md documentation and executed them. After executing phpunit I encountered this error.
Screenshot from 2023-10-28 20-39-58

To reproduce

This is the steps I took to reproduce the behavior:

  1. Ran cd PHP_CodeSniffer
  2. Ran bin/phpcs
  3. Ran phpunit

This was the output after executing script bin/phpcs
Screenshot from 2023-10-28 21-22-44

My environment details

Operating System Ubuntu 22.04.2 LTS
PHP version 8.2.8
PHP_CodeSniffer version 3.5.5, master
Standard [e.g., PSR2, PSR12, Squiz, custom]
Install type git clone
PHPUnit version 9.5.10

Please confirm:

  • I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
@jrfnl
Copy link
Contributor

jrfnl commented Oct 28, 2023

@nelson1995 Thank you for your interest in contributing to PHPCS.

This is not a bug, but a question though, so please don't open a bug report for something like this.

Now, as for running the unit tests, there are a couple of issues here:

  1. You are trying to run the tests with an incompatible PHPUnit version. The tests are currently only compatible with PHPUnit 4 - 7, not with PHPUnit 9. There is a PR open to change this.
  2. You are trying to run the tests on PHP 8.2. While this is possible with PHPUnit 7, the config file will not parse, so you would need to pass the config via the command line.

To get up and running quickly, I'd suggest running composer install and then using vendor/bin/phpunit on PHP 7.4.

If you want more extensive information, I suggest you have a read through the open PR which updates the CONTRIBUTING.md file.

@nelson1995
Copy link
Author

@jrfnl my apologies for the error. Thank you for the feedback. I’m going to resolve it.

@nelson1995
Copy link
Author

nelson1995 commented Nov 11, 2023 via email

@jrfnl
Copy link
Contributor

jrfnl commented Nov 11, 2023

@nelson1995 I honestly don't know. Try running composer du to make sure the autoload file is up to date.

@nelson1995
Copy link
Author

nelson1995 commented Nov 11, 2023 via email

@jrfnl
Copy link
Contributor

jrfnl commented Nov 11, 2023

@nelson1995 Well, as I don't see the error, there's not much I can do to help you without you providing more information....

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

No branches or pull requests

2 participants