Make WordPress Core

Opened 3 months ago

Closed 3 months ago

Last modified 4 days ago

#60305 closed enhancement (fixed)

Ensure that `Tests_Theme_wpThemeJson::test_set_spacing_sizes_should_detect_invalid_spacing_scale` is compatible with PHPUnit 10

Reported by: antonvlasenko's profile antonvlasenko Owned by: youknowriad's profile youknowriad
Milestone: 6.5 Priority: normal
Severity: minor Version: 6.5
Component: Editor Keywords: has-patch has-unit-tests dev-feedback
Focuses: Cc:


The test_set_spacing_sizes_should_detect_invalid_spacing_scale() test method is incompatible with PHPUnit 10 because the TestCase::expectNotice() method is deprecated.
The changes from need to be backported for that test method to Core to ensure compatibility with PHP 10.

Change History (11)

#1 @antonvlasenko
3 months ago

I'm working on a PR for this ticket.

This ticket was mentioned in PR #5911 on WordPress/wordpress-develop by @antonvlasenko.

3 months ago

  • Keywords has-patch has-unit-tests added; needs-patch removed

This PR aims to backport to Core to ensure that Tests_Theme_wpThemeJson::test_set_spacing_sizes_should_detect_invalid_spacing_scale is compatible with PHPUnit 10

Trac ticket:

#3 @youknowriad
3 months ago

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

In 57332:

Editor: Ensure PHPUnit10 compatibility for ThemeJson unit test.

Expecting E_STRICT, E_NOTICE, and E_USER_NOTICE errors is deprecated in PHPUnit 10.
This updates the test to rely on an exception instead.

Props antonvlasenko.
Fixes #60305.

#5 @kebbet
3 months ago

Please milestone the ticket to 6.5 @youknowriad, thanks!

#6 @youknowriad
3 months ago

  • Milestone changed from Awaiting Review to 6.5

#7 @youknowriad
3 months ago

Good call thanks @kebbet

#8 @desrosj
3 months ago

Related: #59486.

This ticket was mentioned in PR #5950 on WordPress/wordpress-develop by @jorbin.

3 months ago

set_error_handler is a global change that should be cleaned up

Trac ticket:

#10 @jorbin
3 months ago

In 57361:

Build/Tests: Ensure set_error_handler is cleaned up.

Follow up to: [57332].

Fixes #60305.

#11 @antonvlasenko
4 days ago

  • Keywords dev-feedback added

@jorbin I believe it might be worth considering a revert of, as it appears that its code does not get executed.
The handler is already being cleaned up within the new error handler itself:

			static function ( $errno, $errstr ) {
				restore_error_handler(); // <-- This is where it's cleaned up.
				throw new Exception( $errstr, $errno );
Last edited 4 days ago by antonvlasenko (previous) (diff)
Note: See TracTickets for help on using tickets.