Last active
October 9, 2021 05:06
-
-
Save jsdecena/5a7a84c974d9c618063c4ba26860f139 to your computer and use it in GitHub Desktop.
Simple TDD - Timezone test, failed scenario
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 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 = Carbon::now(); | |
$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