Without this dependency I get the error:

Error: Class 'PHPUnit\Runner\Version' not found in require_once() 
CommentFileSizeAuthor
#2 upgrade_status-3049116.patch437 bytestobiasb
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tobiasb created an issue. See original summary.

tobiasb’s picture

FileSize
437 bytes

This is the same dependency as the core has.

tobiasb’s picture

Issue summary: View changes
Status: Active » Needs review
herczogzoltan’s picture

Hey @tobiasb !

Thanks for your feedback! Upgrade status depends on phpstan-drupal which already requires "phpunit/phpunit": "^7.5" does that not suffice by itself?

tobiasb’s picture

Only as dev-dep. https://github.com/mglaman/phpstan-drupal/blob/master/composer.json#L20 therefore it will not be installed.

  • herczogzoltan committed 6ccc11c on 8.x-1.x
    Issue #3049116 by tobiasb: Add phpunit/phpunit as dependency
    
herczogzoltan’s picture

Nice catch @tobiasb ! I was able to reproduce the error. Added your patch into the dev branch! It'll be in the next release, thanks!

herczogzoltan’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Gábor Hojtsy’s picture

In #3106615: Remove dependency on phpunit we are wondering why was this added. Why does Upgrade Status need it as a normal dependency and not a dev dependency (which via drupal core it already has).

tobiasb’s picture

Dev-Deps in a composer.json are only installed, when the composer.json is the root-composer.json.

And phpunit is an explicit dependency, therefore upgrade_status should depend on the phpunit like drupal/core itself.

Gábor Hojtsy’s picture

@tobiasb: yes, but core also only have phpunit as a dev dependency. Can you try with 2.x-dev of Upgrade Status (that currently does not depend on phpunit), if the same problem reappears?

tobiasb’s picture

With 8.x-2.* is all fine.