Skip to:
Content

#7204 closed defect (bug) (fixed)

Unit tests failing on PHP 7.0.9

Reported by: DJPaul Owned by: boonebgorges
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Cc:

Description

From Travis-CI. Suspected cause is a change in their environment which they moved from PHP 7.0.8 to 7.0.9. I don't know if this only affects the test or actually some feature in BuddyPress. Move the milestone appropriately.

There were 6 errors:
1) BP_Tests_BP_Attachment_TestCases::test_bp_attachment_upload
Parameter 1 to BP_Tests_BP_Attachment_TestCases::upload_error_handler() expected to be a reference, value given
/tmp/wordpress/src/wp-admin/includes/file.php:319
/tmp/wordpress/src/wp-admin/includes/file.php:449
/tmp/wordpress/src/wp-content/plugins/BuddyPress/src/bp-core/classes/class-bp-attachment.php:272
/tmp/wordpress/src/wp-content/plugins/BuddyPress/tests/phpunit/testcases/core/class-bp-attachment.php:160
2) BP_Tests_BP_Attachment_TestCases::test_bp_attachment_upload_no_base_dir_specific_time
Parameter 1 to BP_Tests_BP_Attachment_TestCases::upload_error_handler() expected to be a reference, value given
/tmp/wordpress/src/wp-admin/includes/file.php:365
/tmp/wordpress/src/wp-admin/includes/file.php:449
/tmp/wordpress/src/wp-content/plugins/BuddyPress/src/bp-core/classes/class-bp-attachment.php:272
/tmp/wordpress/src/wp-content/plugins/BuddyPress/tests/phpunit/testcases/core/class-bp-attachment.php:205
3) BP_Tests_BP_Attachment_TestCases::test_bp_attachment_avatar_user_upload
Parameter 1 to BP_Tests_BP_Attachment_TestCases::upload_error_handler() expected to be a reference, value given
/tmp/wordpress/src/wp-admin/includes/file.php:365
/tmp/wordpress/src/wp-admin/includes/file.php:449
/tmp/wordpress/src/wp-content/plugins/BuddyPress/src/bp-core/classes/class-bp-attachment.php:272
/tmp/wordpress/src/wp-content/plugins/BuddyPress/tests/phpunit/testcases/core/class-bp-attachment.php:241
4) BP_Tests_BP_Attachment_TestCases::test_bp_attachment_avatar_group_upload
Parameter 1 to BP_Tests_BP_Attachment_TestCases::upload_error_handler() expected to be a reference, value given
/tmp/wordpress/src/wp-admin/includes/file.php:365
/tmp/wordpress/src/wp-admin/includes/file.php:449
/tmp/wordpress/src/wp-content/plugins/BuddyPress/src/bp-core/classes/class-bp-attachment.php:272
/tmp/wordpress/src/wp-content/plugins/BuddyPress/tests/phpunit/testcases/core/class-bp-attachment.php:294
5) BP_Tests_BP_Attachment_TestCases::test_bp_attachment_cover_image_user_upload
Parameter 1 to BP_Tests_BP_Attachment_TestCases::upload_error_handler() expected to be a reference, value given
/tmp/wordpress/src/wp-admin/includes/file.php:365
/tmp/wordpress/src/wp-admin/includes/file.php:449
/tmp/wordpress/src/wp-content/plugins/BuddyPress/src/bp-core/classes/class-bp-attachment.php:272
/tmp/wordpress/src/wp-content/plugins/BuddyPress/tests/phpunit/testcases/core/class-bp-attachment.php:368
6) BP_Tests_BP_Attachment_TestCases::test_bp_attachment_upload_dir_filter_arg
Parameter 1 to BP_Tests_BP_Attachment_TestCases::upload_error_handler() expected to be a reference, value given
/tmp/wordpress/src/wp-admin/includes/file.php:365
/tmp/wordpress/src/wp-admin/includes/file.php:449
/tmp/wordpress/src/wp-content/plugins/BuddyPress/src/bp-core/classes/class-bp-attachment.php:272
/tmp/wordpress/src/wp-content/plugins/BuddyPress/tests/phpunit/testcases/core/class-bp-attachment.php:492

Change History (5)

#1 @DJPaul
18 months ago

  • Owner set to boonebgorges
  • Status changed from new to assigned

This ticket was mentioned in Slack in #buddypress by djpaul. View the logs.


18 months ago

#4 @boonebgorges
18 months ago

  • Milestone changed from 2.6.2 to 2.7

Uploads themselves appear to be working properly and without throwing notices, presumably because when running from the front end, we aren't defining a custom upload_error_handler().

I'm going to remove the reference requirement from the method signature. We can reassess when/if the PHP bug is addressed.

#5 @boonebgorges
18 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 10983:

Don't expect a reference in upload_error_handler() for attachments tests.

A bug in PHP 7.0.9+ is causing an error here, because of the way it
handles references in certain cases. See https://bugs.php.net/bug.php?id=72598.

Fixes #7204.

Note: See TracTickets for help on using tickets.