Skip to content

Conflicting Timezones between test database seeder and phpunit tests #5881

@ramel-contria

Description

@ramel-contria

Describe the Bug

Since v25.11 and the Introduction of the server arguments APP_TIMEZONE and APP_DISPLAY_TIMEZONE in phpunit.xml, tests fail if you have set the APP_TIMEZONE in the .env file to a different timezone. This occurs due to the seeder using the timezone set in .env and the tests using the timezone set in phpunit.xml. We found this bug when we updated and ran the tests localy, as we use Europe/Zurich as our APP_TIMEZONE.

Steps to Reproduce

  1. Change the APP_TIMEZONE in .env to something like Europe/Zurich or Antarctica/Vostok
  2. Run the database seeder with composer refresh-test-database
  3. Run the tests composer test

Expected Behaviour

Expected would be that the test-database seeder uses the APP_TIMEZONE of the phpunit.xml

Failing tests

AuditLogTest

  • test_shows_activity

PageDraftTest

  • test_alert_message_shows_if_someone_else_editing
  • test_draft_save_shows_alert_if_draft_edit_started_by_someone_else

PageTest

  • test_recently_updated_pages_view
  • test_recently_updated_pages_view_shows_parent_chain
  • test_recently_updated_pages_view_does_not_show_parent_if_not_visible
  • test_recently_updated_pages_on_home

UserApiTokenTest

  • test_create_api_token
  • test_user_manage_can_delete_token_without_api_permission_themselves

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

v25.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions