WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 6 months ago

#53015 closed enhancement (fixed)

Grunt tasks for PHPUnit should use the version installed by Composer

Reported by: ocean90 Owned by: 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 8 months ago.

Download all attachments as: .zip

Change History (3)

@ocean90
8 months ago

#1 @ocean90
8 months 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
6 months 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.