WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 9 months ago

#48317 closed defect (bug) (worksforme)

Unit Test Failures

Reported by: mjmaterna Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: reporter-feedback
Focuses: Cc:

Description

Setting up development environment and ran unit test, using phpUnit. Getting errors relating to metadata size element. Looking at the code, i.e the $data[media_details][sizes] should be an array. From looking at the code in a debugger, the array [sizes] has zero elements. Code is from the master branch.

Seems like an environment set up issue. The environment is:

Window 10 Home
MySQL Version 5.7.19
IIS
PHP 7.3.10 (cli) (built: Sep 24 2019 11:58:16) ( NTS MSVC15 (Visual C++ 2017) x64 )
PHPUnit 7.5.16 by Sebastian Bergmann and contributors.

See attached for log file and debugging info.

Attachments (2)

log3.txt (181.3 KB) - added by mjmaterna 2 years ago.
Log File
Debugger.zip (1.5 MB) - added by mjmaterna 2 years ago.
Dedugger screen shots

Download all attachments as: .zip

Change History (6)

@mjmaterna
2 years ago

Log File

@mjmaterna
2 years ago

Dedugger screen shots

This ticket was mentioned in Slack in #core by mjmaterna. View the logs.


2 years ago

#2 @johnbillion
15 months ago

  • Keywords reporter-feedback added

I'm very sorry you never got a response to this issue @mjmaterna . Does the problem still occur?

#3 @SergeyBiryukov
15 months ago

Looking at the log, it seems like most of the failures were addressed in #31432, and some are related to #41345.

There are also some media-related errors, but I can't reproduce them locally:

There were 5 errors:

1) Tests_Image_Intermediate_Size::test_get_intermediate_size_with_small_size_array_fallback
Undefined index: thumbnail

C:\Users\mjmat\Source\Repos\wordpress-develop\tests\phpunit\tests\image\intermediateSize.php:256

2) Tests_Media::test_wp_calculate_image_srcset_with_edits
Undefined index: medium

C:\Users\mjmat\Source\Repos\wordpress-develop\tests\phpunit\tests\media.php:1534

3) Tests_Media::test_wp_calculate_image_sizes
Undefined index: thumbnail

C:\Users\mjmat\Source\Repos\wordpress-develop\tests\phpunit\tests\media.php:1926

4) WP_Test_REST_Attachments_Controller::test_get_item_sizes
Error: Cannot use object of type stdClass as array

C:\Users\mjmat\Source\Repos\wordpress-develop\tests\phpunit\tests\rest-api\rest-attachments-controller.php:575

5) WP_Test_REST_Attachments_Controller::test_get_item_sizes_with_no_url
Error: Cannot use object of type stdClass as array

C:\Users\mjmat\Source\Repos\wordpress-develop\tests\phpunit\tests\rest-api\rest-attachments-controller.php:603

#4 @desrosj
9 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

I'm going to close this out as it's been 6 months since the last update, and it still requires some reporter-feedback. @mjmaterna if you're still able to reproduce the issue, please do reopen and provide more details so it can be investigated.

Note: See TracTickets for help on using tickets.