Added vendor/ directory for Composer's installed files
This commit is contained in:
36
vendor/nesbot/carbon/tests/CarbonIntervalAddTest.php
vendored
Executable file
36
vendor/nesbot/carbon/tests/CarbonIntervalAddTest.php
vendored
Executable file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Carbon package.
|
||||
*
|
||||
* (c) Brian Nesbitt <brian@nesbot.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Carbon\CarbonInterval;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class CarbonIntervalAddTest extends TestFixture
|
||||
{
|
||||
public function testAdd()
|
||||
{
|
||||
$ci = CarbonInterval::create(4, 3, 6, 7, 8, 10, 11)->add(new DateInterval('P2Y1M5DT22H33M44S'));
|
||||
$this->assertCarbonInterval($ci, 6, 4, 54, 30, 43, 55);
|
||||
}
|
||||
|
||||
public function testAddWithDiffDateInterval()
|
||||
{
|
||||
$diff = Carbon::now()->diff(Carbon::now()->addWeeks(3));
|
||||
$ci = CarbonInterval::create(4, 3, 6, 7, 8, 10, 11)->add($diff);
|
||||
$this->assertCarbonInterval($ci, 4, 3, 70, 8, 10, 11);
|
||||
}
|
||||
|
||||
public function testAddWithNegativeDiffDateInterval()
|
||||
{
|
||||
$diff = Carbon::now()->diff(Carbon::now()->subWeeks(3));
|
||||
$ci = CarbonInterval::create(4, 3, 6, 7, 8, 10, 11)->add($diff);
|
||||
$this->assertCarbonInterval($ci, 4, 3, 28, 8, 10, 11);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user