[Wp-unit-tests] [576] wp-testlib/base.php: Use static variable for isTracTicketClosed cached.

Andrew Nacin wp at andrewnacin.com
Wed Mar 14 15:15:49 UTC 2012


On Wed, Mar 14, 2012 at 11:12 AM, Kurt Payne <
kpayne+wordpress+tests at gmail.com> wrote:

> Nacin,
>
> This doesn't work for me.  I started by using a static var.  I added
> some debug output at the top of the function and the cache was not
> behaving as desired.
>
> If I had to conjecture about what was going on .... the
> "isTracTicketClosed" function is part of a class which gets extended.
> Any static scope is associated with the instantiated class name as
> well as the method name.
>
> For example, TestSanitizeUser::isTracTicketClosed vs.
> TestSanitizeTitleWithDashes::isTracTicketClosed
>
> Can you reproduce?
>

Interesting. In that case, it should probably become a protected static
class variable.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/wp-unit-tests/attachments/20120314/c27759d2/attachment.htm>


More information about the wp-unit-tests mailing list