[wp-trac] [WordPress Trac] #35236: remove_rewrite_tag()

WordPress Trac noreply at wordpress.org
Tue Jan 5 04:54:00 UTC 2016


#35236: remove_rewrite_tag()
--------------------------------------+------------------
 Reporter:  swissspidy                |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  4.5
Component:  Rewrite Rules             |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------

Comment (by boonebgorges):

 In your tests, you're using `array_pop()` to test the presence of a value
 in `$wp_rewrite` properties. This is dangerous: `array_pop()` modifies the
 original array, which might break later tests. Can you use
 `assertContains()` and `assertNotContains()` instead? If it's important to
 check that it's the last item in the array, maybe you could use `end()`?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35236#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list