Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Test_Widget compatible with WP_Widget #34355

Merged
merged 3 commits into from
Aug 30, 2021
Merged

Conversation

adamziel
Copy link
Contributor

Today I noticed that running certains e2e tests locally logs the following errors:

  ● Widgets Customizer › should handle the inserter outer section

    Unexpected error in page content: Warning: Declaration of Test_Widget::update($new_instance) should be compatible with WP_Widget::update($new_instance, $old_instance) in /var/www/html/wp-content/plugins/gutenberg-test-plugins/class-test-widget.php on line 65

      at visitAdminPage (../e2e-test-utils/build/@wordpress/e2e-test-utils/src/visit-admin-page.js:38:9)
          at runMicrotasks (<anonymous>)
      at Object.<anonymous> (specs/widgets/customizing-widgets.test.js:28:3
  ● Widgets Customizer › should move (inner) blocks to another sidebar

    Unexpected error in page content: Notice: Undefined index: title in /var/www/html/wp-content/plugins/gutenberg-test-plugins/class-test-widget.php on line 51

      at visitAdminPage (../e2e-test-utils/build/@wordpress/e2e-test-utils/src/visit-admin-page.js:38:9)
          at runMicrotasks (<anonymous>)
      at Object.<anonymous> (specs/widgets/customizing-widgets.test.js:28:3)

Turns out that the signature of Test_Widget::update is indeed incompatible with WP_Widget::update. This PR adjusts class Test_Widget to fix these two problems.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and CI is green 👍🏻

@adamziel adamziel merged commit b2c4a00 into trunk Aug 30, 2021
@adamziel adamziel deleted the fix/test-widget-class branch August 30, 2021 10:24
@github-actions github-actions bot added this to the Gutenberg 11.5 milestone Aug 30, 2021
@getsource getsource added the [Type] Bug An existing feature does not function as intended label Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] E2E Tests /packages/e2e-tests [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants