[wp-trac] [WordPress Trac] #35053: XML-RPC when post with date_created_gmt, its post_date will gmt date not local date

WordPress Trac noreply at wordpress.org
Sun Jan 3 17:39:45 UTC 2016


#35053: XML-RPC when post with date_created_gmt, its post_date will gmt date not
local date
-------------------------------------+-----------------------------
 Reporter:  hnle                     |       Owner:  wonderboymusic
     Type:  defect (bug)             |      Status:  assigned
 Priority:  normal                   |   Milestone:  4.4.1
Component:  XML-RPC                  |     Version:  4.4
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch commit revert  |     Focuses:
-------------------------------------+-----------------------------
Changes (by nacin):

 * keywords:  has-unit-tests needs-testing => has-patch commit revert


Comment:

 Thank you for the feedback, @redsweater and @dossy. Marking [34681] for
 revert.

 Replying to [comment:26 dossy]:
 > Oh, now I remember why I used the try/catch pattern in the tests I
 wrote: I needed to ensure that `update_option( 'timezone_string', $tz );`
 got called ''after'' a failed PHPUnit assertion, to restore the pre-test
 `timezone_string` value, since the tests modify it.
 >
 > Really, I should have done this inside PHPUnit's `setUp()` and
 `tearDown()`.  I've uploaded a fresh patch that improves the tests this
 way, see [attachment:35053-3.patch].

 This actually isn't necessary. You're right that `tearDown()` is normally
 the correct approach, but our own `WP_UnitTestCase` rolls back DB writes
 as well as the local object cache, so you don't need to restore option
 values.

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


More information about the wp-trac mailing list