Skip to content

Commit

Permalink
Merge pull request #2563 from crhg/fix_create_from_time_test
Browse files Browse the repository at this point in the history
Fix CreateFromTimeTest
  • Loading branch information
kylekatarnls authored Mar 10, 2022
2 parents 82ff75d + 67a972e commit 78a4397
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/Carbon/CreateFromTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ public function testCreateFromTimeWithSecond()
public function testCreateFromTimeWithDateTimeZone()
{
$d = Carbon::createFromTime(12, 0, 0, new DateTimeZone('Europe/London'));
$this->assertCarbon($d, Carbon::now()->year, Carbon::now()->month, Carbon::now()->day, 12, 0, 0);
$this->assertCarbon($d, Carbon::now('Europe/London')->year, Carbon::now('Europe/London')->month, Carbon::now('Europe/London')->day, 12, 0, 0);
$this->assertSame('Europe/London', $d->tzName);
}

public function testCreateFromTimeWithTimeZoneString()
{
$d = Carbon::createFromTime(12, 0, 0, 'Europe/London');
$this->assertCarbon($d, Carbon::now()->year, Carbon::now()->month, Carbon::now()->day, 12, 0, 0);
$this->assertCarbon($d, Carbon::now('Europe/London')->year, Carbon::now('Europe/London')->month, Carbon::now('Europe/London')->day, 12, 0, 0);
$this->assertSame('Europe/London', $d->tzName);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/CarbonImmutable/CreateFromTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ public function testCreateFromTimeWithSecond()
public function testCreateFromTimeWithDateTimeZone()
{
$d = Carbon::createFromTime(12, 0, 0, new DateTimeZone('Europe/London'));
$this->assertCarbon($d, Carbon::now()->year, Carbon::now()->month, Carbon::now()->day, 12, 0, 0);
$this->assertCarbon($d, Carbon::now('Europe/London')->year, Carbon::now('Europe/London')->month, Carbon::now('Europe/London')->day, 12, 0, 0);
$this->assertSame('Europe/London', $d->tzName);
}

public function testCreateFromTimeWithTimeZoneString()
{
$d = Carbon::createFromTime(12, 0, 0, 'Europe/London');
$this->assertCarbon($d, Carbon::now()->year, Carbon::now()->month, Carbon::now()->day, 12, 0, 0);
$this->assertCarbon($d, Carbon::now('Europe/London')->year, Carbon::now('Europe/London')->month, Carbon::now('Europe/London')->day, 12, 0, 0);
$this->assertSame('Europe/London', $d->tzName);
}

Expand Down

0 comments on commit 78a4397

Please sign in to comment.