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

PHPUnit autoload not working #277

Open
jmsche opened this issue Jun 9, 2023 · 2 comments
Open

PHPUnit autoload not working #277

jmsche opened this issue Jun 9, 2023 · 2 comments

Comments

@jmsche
Copy link

jmsche commented Jun 9, 2023

Hi,

I managed to setup collision without issues in a project using PHPUnit v9 and collision v6.

However it was quite hard to set it up in a project using PHPUnit v10 and collision v7.

Full context:

  • Symfony 6.3 app
  • PHPUnit 10.2.1
  • collision 7.5.2

After digging a lot, I see that https://github.com/nunomaduro/collision/blob/v7.x/src/Adapters/Phpunit/Autoload.php is loaded... but by PHPUnit, so setting the COLLISION_PRINTER var in phpunit.xml can't trigger it.

I have to call this manually in my tests/bootstrap.php file (that is configured in PHPUnit config):

\NunoMaduro\Collision\Adapters\Phpunit\Subscribers\EnsurePrinterIsRegisteredSubscriber::register();

However, calling PHPUnit by passing the COLLISION_PRINTER var there does work:

COLLISION_PRINTER=ReportablePrinter vendor/bin/phpunit tests/Twig/ --no-output

Is this expected? Should I stick calling register() manually?

@CrazyBoy49z
Copy link

CrazyBoy49z commented Aug 9, 2023

update illuminate/contracts ^v10.17 carbon ^2.67

@Rezrazi
Copy link

Rezrazi commented Oct 14, 2023

any insights regarding this @nunomaduro ?
We're seeing a lot of failure across our pipelines, for instance: https://github.com/oneduo/laravel-gitlab-webhook-client/actions/runs/6518876577
It almost seems to be randomly occurring

Additionally, I would want to keep compatibility with 10.x rather than locking to a higher version

Thanks

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

No branches or pull requests

3 participants