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

FakeAccess update idsite comparison for all to strict #18115

Closed
AltamashShaikh opened this issue Oct 8, 2021 · 0 comments · Fixed by #18116
Closed

FakeAccess update idsite comparison for all to strict #18115

AltamashShaikh opened this issue Oct 8, 2021 · 0 comments · Fixed by #18116
Labels
Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced.

Comments

@AltamashShaikh
Copy link
Contributor

AltamashShaikh commented Oct 8, 2021

FakeAccess update idsite comparison for all to strict

Expected Behavior

https://github.com/matomo-org/matomo/blob/4.x-dev/tests/PHPUnit/Framework/Mock/FakeAccess.php#L169
'0' == 'all' should return false, but returns true for PHP version < 8

It should return false since we have a strict check when not testing via FakeAccess

Current Behavior

'0' == 'all' is returning true for PHP versions < 7

Possible Solution

change the condition to $idSites === 'all' in https://github.com/matomo-org/matomo/blob/4.x-dev/tests/PHPUnit/Framework/Mock/FakeAccess.php#L169

Steps to Reproduce (for Bugs)

  1. Refer this url to test the behaviour https://3v4l.org/17cZ2

Context

This bug breaks test cases when running on php8

Your Environment

  • Matomo Version:
  • PHP Version:
  • Server Operating System:
  • Additionally installed plugins:
  • Browser:
  • Operating System:
@AltamashShaikh AltamashShaikh added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant