From 63f0cb32e6ef8ebc351af103f25fa5c0f6abe7a9 Mon Sep 17 00:00:00 2001 From: Jon Sugar Date: Mon, 8 Nov 2021 20:15:53 +0000 Subject: [PATCH] Fix test failing due to timezone weirdness. fixes: #169 --- app/Actions/UpgradeSavedConfiguration.php | 2 +- tests/Feature/UpgradeSavedConfigurationTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Actions/UpgradeSavedConfiguration.php b/app/Actions/UpgradeSavedConfiguration.php index e8c62e34..fb1807fb 100644 --- a/app/Actions/UpgradeSavedConfiguration.php +++ b/app/Actions/UpgradeSavedConfiguration.php @@ -84,7 +84,7 @@ public function upgrade(string $savedConfiguration, array $removedConfigurationK return implode(PHP_EOL, [ $this->commentRemovedConfiguration($savedConfiguration, $removedConfigurationKeys), "\n# ------------------------------------------------------------------------------", - '# ' . Carbon::now()->format('j-M-Y g:i a') . ' (auto-generated by Lambo):', + '# ' . Carbon::now(config('app.timezone'))->format('j-M-Y g:i a') . ' (auto-generated by Lambo):', '# ------------------------------------------------------------------------------', $this->summarizeComments(), $this->addNewConfiguration($newConfiguration), diff --git a/tests/Feature/UpgradeSavedConfigurationTest.php b/tests/Feature/UpgradeSavedConfigurationTest.php index 14b2a49a..d637e814 100644 --- a/tests/Feature/UpgradeSavedConfigurationTest.php +++ b/tests/Feature/UpgradeSavedConfigurationTest.php @@ -40,7 +40,7 @@ class UpgradeSavedConfigurationTest extends TestCase /** @test */ function it_upgrades_saved_configuration() { - $this->travelTo(Carbon::parse('17-Jul-2016 20:51:08', 'America/New_York')); + $this->travelTo(Carbon::parse('01-Jan-2000 00:00:00', config('app.timezone'))); $upgradedConfiguration = app(UpgradeSavedConfiguration::class)->upgrade($this->getConfiguration(), $this->removedConfigurationKeys, $this->newConfiguration); @@ -52,7 +52,7 @@ function it_upgrades_saved_configuration() # ------------------------------------------------------------------------------ -# 17-Jul-2016 8:51 pm (auto-generated by Lambo): +# 1-Jan-2000 12:00 am (auto-generated by Lambo): # ------------------------------------------------------------------------------ # Lambo has commented out the following configuration items as they # are no-longer used. You may safely remove them: