Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

[ECS] Prefixed version and custom sniff testing has misses parent test case #3424

Closed
TomasVotruba opened this issue Jul 21, 2021 · 7 comments

Comments

@TomasVotruba
Copy link
Member

@TomasVotruba I've installed dev-main, now I got Class 'Symplify\PackageBuilder\Testing\AbstractKernelTestCase' not found in .../vendor/symplify/easy-coding-standard/src/Testing/PHPUnit/AbstractCheckerTestCase.php:19. Ohhhh.

Originally posted by @ERuban in #3422 (comment)

@ERuban
Copy link
Contributor

ERuban commented Aug 3, 2021

Hi, @TomasVotruba
any updates or ideas how to fix it?

@TomasVotruba
Copy link
Member Author

Hi, I would create reproducible repository and try to update AbstractCheckerTestCase namespace in the /vendor, untill it works. Then apply the manual change in as a script in scoper.php file.

@ERuban
Copy link
Contributor

ERuban commented Aug 3, 2021

Ok, so I've created reproducible repository https://github.com/ERuban/ecs-testing-issue-example
Have tried to do some in the /vendor but without success.

@TomasVotruba
Copy link
Member Author

TomasVotruba commented Aug 4, 2021

After 2 days of work, I think I've made some progress. For future generations of scoping and downgrading explorers. There have been couple of bugs to solve this issue:

  • make sure the regex starts and ends with same character 7cb57dc, otherwise there is silent error that leads to skipping whole file (I wish there was an exceptoin, but php-scoper ignores it)
  • include scoper-autoload.php at the start of your project - 4c9c044, otherwise all un-scoped classes are ignored
  • make sure you downgrade to correct version - to PHP 7.1, not to PHP 7.0, the PHPUnit will fail on extra void type then - 95f5ca6
  • make the Abstract*TestCase as simple as possible, avoid to multiple inheritance that would require complex logic hard to debug - 826cd78

@ERuban Could you verify in your test repository? I tried it myself, but want to be sure it doesn't work only on my machine ;)

  • use easy-coding-standard version dev-main
composer update
vendor/bin/phpunit

@ERuban
Copy link
Contributor

ERuban commented Aug 4, 2021

Hey, looks that it works in my test repo, great, thank you!
Waiting for the release ;)

@TomasVotruba
Copy link
Member Author

Thanks for confirmation 🪂 👍

@TomasVotruba
Copy link
Member Author

The 9.4.25 has been just tagged 🔨

@deprecated-packages deprecated-packages locked as resolved and limited conversation to collaborators Nov 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants