Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#53015 closed enhancement (fixed)

Grunt tasks for PHPUnit should use the version installed by Composer

Reported by: ocean90's profile ocean90 Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

PHPUnit was added as a Composer dev dependency in [47881] which is working fine when using composer run test.
But any Grunt task which is using phpunit will fail if a developer doesn't have PHPUnit installed globally. Examples are npm run grunt phpunit or npm run grunt precommit.

This should be changed to make it easier to run such tasks without having to figure out how and which PHPUnit version needs to be installed. Similar is already done for the format:php task.

Attachments (1)

53015.diff (1.6 KB) - added by ocean90 3 years ago.

Download all attachments as: .zip

Change History (3)

@ocean90
3 years ago

#1 @ocean90
3 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Future Release to 5.8

53015.diff makes sure that the composer test command is used and all arguments are still passed to PHPUnit.

#2 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 51016:

Build/Test Tools: Use the Composer-installed version of PHPUnit for Grunt tasks.

This makes it easier to run phpunit Grunt tasks without having to figure out how and which PHPUnit version needs to be installed.

It also more closely matches the format:php task.

Follow-up to [47881].

Props ocean90.
Fixes #53015.

Note: See TracTickets for help on using tickets.