forked from briannesbitt/Carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for issue briannesbitt#1073.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ php: | |
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- 7.0.22 | ||
- 7.1 | ||
- hhvm | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Carbon package. | ||
* | ||
* (c) Brian Nesbitt <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Tests; | ||
|
||
use Carbon\Carbon; | ||
use Tests\AbstractTestCase; | ||
|
||
class IssueTest extends AbstractTestCase | ||
{ | ||
public function testIssue1073() | ||
{ | ||
$date = \DateTime::createFromFormat('Y-m-d\TH:i:s.uT', '2017-07-29T13:57:27.123456Z'); | ||
$d1 = $date->format('Y-m-d H:i:s.u e'); // 2017-07-29 13:57:27.123456 Z | ||
|
||
$date = Carbon::createFromFormat('Y-m-d\TH:i:s.uT', '2017-07-29T13:57:27.123456Z'); | ||
$d2 = $date->format('Y-m-d H:i:s.u e'); // 2017-07-29 13:57:27.000000 Z | ||
|
||
$this->assertTrue($d1 === $d2); | ||
} | ||
} |