Skip to content

Commit

Permalink
Added test for issue briannesbitt#1073.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavic committed Feb 5, 2018
1 parent 926aee5 commit 6770b86
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ php:
- 5.5
- 5.6
- 7.0
- 7.0.22
- 7.1
- hhvm

Expand Down
29 changes: 29 additions & 0 deletions tests/IssueTest.php
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);
}
}

0 comments on commit 6770b86

Please sign in to comment.