Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#28986 closed defect (bug) (worksforme)

Define expected hooks in WP_UnitTestCase::$hooks_saved

Reported by: danielbachhuber Owned by: wonderboymusic
Priority: normal Milestone:
Component: Build/Test Tools Version:
Severity: normal Keywords:
Cc: Focuses:

Description

From r29251.

Can cause error notices in third-party uses of WP_UnitTestCase

Attachments (1)

28986.1.diff​ (594 bytes ) - added by danielbachhuber 12 years ago.

Download all attachments as: .zip

Change History (7)

#1 @wonderboymusic
12 years ago

  • Owner set to wonderboymusic
  • Resolution → fixed
  • Status new → closed

In 29267:

After [29251], set the array keys in WP_UnitTestCase::$hooks_saved to prevent notices in 3rd party use cases.

Props danielbachhuber.
Fixes #28986.

#2 @TobiasBg
12 years ago

  • Resolution fixed
  • Status closed → reopened

This breaks things.

When $hooks_saved is pre-populated (non-empty arrays are true), if ( ! self::$hooks_saved ) { is never true and therefore the hooks are never backed-up.

#3 @ocean90
12 years ago

  • Keywords needs-patch added; has-patch commit removed

#4 @danielbachhuber
12 years ago

This may have been user error on my part. I just realized I'm not calling parent::setUp() in my subclass, and now I can't even reproduce the original bug.

Please do revert. I'll come back if I can track down what exactly happened.

#5 @helen
12 years ago

In 29274:

Revert [29267], as it causes unit test breakage and appears unnecessary. see #28986.

#6 @helen
12 years ago

  • Keywords needs-patch removed
  • Milestone 4.0
  • Resolution → worksforme
  • Status reopened → closed
Note: See TracTickets for help on using tickets.