Created
October 9, 2021 05:31
-
-
Save jsdecena/d5c417124372bf79ead1555fcd95af6a to your computer and use it in GitHub Desktop.
Simple TDD - TimezoneTest - after
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Jsdecena\Simpletdd\Tests\Unit; | |
use Carbon\Carbon; | |
use DateTimeZone; | |
use Illuminate\Foundation\Application; | |
use Jsdecena\SimpleTdd\TimezoneUtil; | |
use Orchestra\Testbench\TestCase; | |
class TimezoneTest extends TestCase | |
{ | |
protected function setUp(): void | |
{ | |
parent::setUp(); | |
} | |
/** | |
* Define environment setup. | |
* | |
* @param Application $app | |
* @return void | |
*/ | |
protected function getEnvironmentSetUp($app) | |
{ | |
// Setup default database to use sqlite :memory: | |
$app['config']->set('simpletdd.timezone', 'America/Los_Angeles'); | |
} | |
/** | |
* @param Application $app | |
* @return array | |
*/ | |
protected function getPackageProviders($app) | |
{ | |
return ['Jsdecena\SimpleTdd\ServiceProvider']; | |
} | |
/** @test */ | |
public function it_should_get_the_config_tz() | |
{ | |
$tzNow = TimezoneUtil::getTimezone(config('simpletdd.timezone')); | |
$this->assertEquals("America/Los_Angeles", $tzNow->getTimezone()->getName()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment