the whole shebang

This commit is contained in:
2014-11-25 16:42:40 +01:00
parent 7f74c0613e
commit ab1334c0cf
3686 changed files with 496409 additions and 1 deletions

View File

@@ -0,0 +1,61 @@
<?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\Carbon;
class TestingAidsTest extends TestFixture
{
public function testTestingAidsWithTestNowNotSet()
{
Carbon::setTestNow();
$this->assertFalse(Carbon::hasTestNow());
$this->assertNull(Carbon::getTestNow());
}
public function testTestingAidsWithTestNowSet()
{
$notNow = Carbon::yesterday();
Carbon::setTestNow($notNow);
$this->assertTrue(Carbon::hasTestNow());
$this->assertSame($notNow, Carbon::getTestNow());
}
public function testConstructorWithTestValueSet()
{
$notNow = Carbon::yesterday();
Carbon::setTestNow($notNow);
$this->assertEquals($notNow, new Carbon());
$this->assertEquals($notNow, new Carbon(null));
$this->assertEquals($notNow, new Carbon(''));
$this->assertEquals($notNow, new Carbon('now'));
}
public function testNowWithTestValueSet()
{
$notNow = Carbon::yesterday();
Carbon::setTestNow($notNow);
$this->assertEquals($notNow, Carbon::now());
}
public function testParseWithTestValueSet()
{
$notNow = Carbon::yesterday();
Carbon::setTestNow($notNow);
$this->assertEquals($notNow, Carbon::parse());
$this->assertEquals($notNow, Carbon::parse(null));
$this->assertEquals($notNow, Carbon::parse(''));
$this->assertEquals($notNow, Carbon::parse('now'));
}
}