Closed (fixed)
Project:
Simplenews Scheduler
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Apr 2012 at 15:50 UTC
Updated:
27 Apr 2012 at 22:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
joachim commentedIt's more likely something funny with timezones going on here:
'@date' => format_date($date->getTimestamp()))))
Comment #2
berdirEnable the assertion and added some debug calls.
Let's see what the testbot is actually doing there.
Comment #3
berdirComment #5
berdirAh, I think this might actually be easier than I thought.
You're calling variable_set('date_default_timezone', 'Europe/Kiev')) in setUp(). This does *not* affect the code within the test, because that relies on the the date_default_timezone_get(), which returns whatever is set in PHP, not Drupal.
However, when we do a page request then we are going through the session handling, which sets the PHP timezone based on that variable.
So, doing that as well in setUp() should probably fix this. I'm not sure if we should do this by default, though but instead only in the test classes we want it and are doing timezone-specific assertions.
Comment #6
berdirYep, that works.
Now without debug().
Comment #7
joachim commented> You're calling variable_set('date_default_timezone', 'Europe/Kiev')) in setUp(). This does *not* affect the code within the test, because that relies on the the date_default_timezone_get(), which returns whatever is set in PHP, not Drupal.
I was expecting the setting of PHP's default in session.inc to have happened by then, but I admit that was an assumption rather than based on any knowledge of what gets set up during a test run!
Thanks for the fix!
- #1528586 by Berdir: Fixed node creation test submitted time failing due to timezone.
Comment #8
joachim commentedBetter title for posterity :)