Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Fix tests #283

Merged
merged 3 commits into from
Mar 5, 2018
Merged

Fix tests #283

merged 3 commits into from
Mar 5, 2018

Conversation

qtsd
Copy link
Contributor

@qtsd qtsd commented Feb 22, 2018

Can help for #276

@qtsd qtsd changed the title Feature/fix tests Fix tests Feb 22, 2018
@qtsd
Copy link
Contributor Author

qtsd commented Feb 28, 2018

To explain the timezone test problem.
Test has been created in 047b7d3 and 5d44cfe and was working.
It has been changed in 74783c0, 2662ece, 773d48c, with inconsistent values.

symfony doc says :

  • model_timezone is the timezone that the input data is stored in
  • view_timezone is the timezone for how the data should be shown to the user (and therefore also the data that the user submits)

In 047b7d3 (the good commit) :

  • model_timezone is UTC : simplifies the reading of the test, because Europe/Paris can be UTC+1 or UTC+2 (winter/summer)
  • view_timezone is Asia/Karachi (UTC+5) : meens 5 hours will be removed on all dates when we submit the form

If we submit a form with a date to 2015-10-20 00:00:00, the date will be stored as 2015-10-19 19:00:00.

Likewise, if we want to retrieve all objects added on 2015-10-20 (and therefore see our previously created object), we should check in the DB :

  • from 2015-10-19 19:00:00 (2015-10-20 00:00:00 - 5 hours)
  • to 2015-10-20 18:59:59 (2015-10-20 23:59:59 - 5 hours)

@gilles-g
Copy link
Member

gilles-g commented Mar 5, 2018

Ah @qtsd you're the man!

Thanks for your help 👍

@gilles-g gilles-g merged commit 13ffb97 into lexik:master Mar 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants