Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1E64710014 for ; Sun, 3 May 2015 12:39:43 +0000 (UTC) Received: (qmail 58734 invoked by uid 500); 3 May 2015 12:39:43 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 58626 invoked by uid 500); 3 May 2015 12:39:43 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 57562 invoked by uid 99); 3 May 2015 12:39:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 May 2015 12:39:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C495EE3D95; Sun, 3 May 2015 12:39:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: smarru@apache.org To: commits@airavata.apache.org Date: Sun, 03 May 2015 12:39:54 -0000 Message-Id: <62bd3b0b147d48818a1c041765762c57@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [14/51] [partial] airavata-php-gateway git commit: removing vendor files http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/CreateFromTimestampTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/CreateFromTimestampTest.php b/vendor/nesbot/carbon/tests/CreateFromTimestampTest.php deleted file mode 100644 index 108faac..0000000 --- a/vendor/nesbot/carbon/tests/CreateFromTimestampTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class CreateFromTimestampTest extends TestFixture -{ - public function testCreateReturnsDatingInstance() - { - $d = Carbon::createFromTimestamp(Carbon::create(1975, 5, 21, 22, 32, 5)->timestamp); - $this->assertCarbon($d, 1975, 5, 21, 22, 32, 5); - } - - public function testCreateFromTimestampUsesDefaultTimezone() - { - $d = Carbon::createFromTimestamp(0); - - // We know Toronto is -5 since no DST in Jan - $this->assertSame(1969, $d->year); - $this->assertSame(-5 * 3600, $d->offset); - } - - public function testCreateFromTimestampWithDateTimeZone() - { - $d = Carbon::createFromTimestamp(0, new \DateTimeZone('UTC')); - $this->assertSame('UTC', $d->tzName); - $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0); - } - - public function testCreateFromTimestampWithString() - { - $d = Carbon::createFromTimestamp(0, 'UTC'); - $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0); - $this->assertSame(0, $d->offset); - $this->assertSame('UTC', $d->tzName); - } - - public function testCreateFromTimestampGMTDoesNotUseDefaultTimezone() - { - $d = Carbon::createFromTimestampUTC(0); - $this->assertCarbon($d, 1970, 1, 1, 0, 0, 0); - $this->assertSame(0, $d->offset); - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/CreateTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/CreateTest.php b/vendor/nesbot/carbon/tests/CreateTest.php deleted file mode 100644 index 513d61d..0000000 --- a/vendor/nesbot/carbon/tests/CreateTest.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class CreateTest extends TestFixture -{ - public function testCreateReturnsDatingInstance() - { - $d = Carbon::create(); - $this->assertTrue($d instanceof Carbon); - } - - public function testCreateWithDefaults() - { - $d = Carbon::create(); - $this->assertSame($d->timestamp, Carbon::now()->timestamp); - } - - public function testCreateWithYear() - { - $d = Carbon::create(2012); - $this->assertSame(2012, $d->year); - } - - public function testCreateWithInvalidYear() - { - $this->setExpectedException('InvalidArgumentException'); - $d = Carbon::create(-3); - } - - public function testCreateWithMonth() - { - $d = Carbon::create(null, 3); - $this->assertSame(3, $d->month); - } - - public function testCreateWithInvalidMonth() - { - $this->setExpectedException('InvalidArgumentException'); - $d = Carbon::create(null, -5); - } - - public function testCreateMonthWraps() - { - $d = Carbon::create(2011, 0, 1, 0, 0, 0); - $this->assertCarbon($d, 2010, 12, 1, 0, 0, 0); - } - - public function testCreateWithDay() - { - $d = Carbon::create(null, null, 21); - $this->assertSame(21, $d->day); - } - - public function testCreateWithInvalidDay() - { - $this->setExpectedException('InvalidArgumentException'); - $d = Carbon::create(null, null, -4); - } - public function testCreateDayWraps() - { - $d = Carbon::create(2011, 1, 40, 0, 0, 0); - $this->assertCarbon($d, 2011, 2, 9, 0, 0, 0); - } - - public function testCreateWithHourAndDefaultMinSecToZero() - { - $d = Carbon::create(null, null, null, 14); - $this->assertSame(14, $d->hour); - $this->assertSame(0, $d->minute); - $this->assertSame(0, $d->second); - } - - public function testCreateWithInvalidHour() - { - $this->setExpectedException('InvalidArgumentException'); - $d = Carbon::create(null, null, null, -1); - } - - public function testCreateHourWraps() - { - $d = Carbon::create(2011, 1, 1, 24, 0, 0); - $this->assertCarbon($d, 2011, 1, 2, 0, 0, 0); - } - - public function testCreateWithMinute() - { - $d = Carbon::create(null, null, null, null, 58); - $this->assertSame(58, $d->minute); - } - - public function testCreateWithInvalidMinute() - { - $this->setExpectedException('InvalidArgumentException'); - $d = Carbon::create(2011, 1, 1, 0, -2, 0); - } - public function testCreateMinuteWraps() - { - $d = Carbon::create(2011, 1, 1, 0, 62, 0); - $this->assertCarbon($d, 2011, 1, 1, 1, 2, 0); - } - - public function testCreateWithSecond() - { - $d = Carbon::create(null, null, null, null, null, 59); - $this->assertSame(59, $d->second); - } - - public function testCreateWithInvalidSecond() - { - $this->setExpectedException('InvalidArgumentException'); - $d = Carbon::create(null, null, null, null, null, -2); - } - public function testCreateSecondsWrap() - { - $d = Carbon::create(2012, 1, 1, 0, 0, 61); - $this->assertCarbon($d, 2012, 1, 1, 0, 1, 1); - } - - public function testCreateWithDateTimeZone() - { - $d = Carbon::create(2012, 1, 1, 0, 0, 0, new \DateTimeZone('Europe/London')); - $this->assertCarbon($d, 2012, 1, 1, 0, 0, 0); - $this->assertSame('Europe/London', $d->tzName); - } - - public function testCreateWithTimeZoneString() - { - $d = Carbon::create(2012, 1, 1, 0, 0, 0, 'Europe/London'); - $this->assertCarbon($d, 2012, 1, 1, 0, 0, 0); - $this->assertSame('Europe/London', $d->tzName); - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/DayOfWeekModifiersTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/DayOfWeekModifiersTest.php b/vendor/nesbot/carbon/tests/DayOfWeekModifiersTest.php deleted file mode 100644 index ead4928..0000000 --- a/vendor/nesbot/carbon/tests/DayOfWeekModifiersTest.php +++ /dev/null @@ -1,288 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class DayOfWeekModifiersTest extends TestFixture -{ - public function testStartOfWeek() - { - $d = Carbon::create(1980, 8, 7, 12, 11, 9)->startOfWeek(); - $this->assertCarbon($d, 1980, 8, 4, 0, 0, 0); - } - - public function testStartOfWeekFromWeekStart() - { - $d = Carbon::createFromDate(1980, 8, 4)->startOfWeek(); - $this->assertCarbon($d, 1980, 8, 4, 0, 0, 0); - } - - public function testStartOfWeekCrossingYearBoundary() - { - $d = Carbon::createFromDate(2013, 12, 31, 'GMT'); - $d->startOfWeek(); - $this->assertCarbon($d, 2013, 12, 30, 0, 0, 0); - } - - public function testEndOfWeek() - { - $d = Carbon::create(1980, 8, 7, 11, 12, 13)->endOfWeek(); - $this->assertCarbon($d, 1980, 8, 10, 23, 59, 59); - } - - public function testEndOfWeekFromWeekEnd() - { - $d = Carbon::createFromDate(1980, 8, 9)->endOfWeek(); - $this->assertCarbon($d, 1980, 8, 10, 23, 59, 59); - } - - public function testEndOfWeekCrossingYearBoundary() - { - $d = Carbon::createFromDate(2013, 12, 31, 'GMT'); - $d->endOfWeek(); - $this->assertCarbon($d, 2014, 1, 5, 23, 59, 59); - } - - public function testNext() - { - $d = Carbon::createFromDate(1975, 5, 21)->next(); - $this->assertCarbon($d, 1975, 5, 28, 0, 0, 0); - } - - public function testNextMonday() - { - $d = Carbon::createFromDate(1975, 5, 21)->next(Carbon::MONDAY); - $this->assertCarbon($d, 1975, 5, 26, 0, 0, 0); - } - - public function testNextSaturday() - { - $d = Carbon::createFromDate(1975, 5, 21)->next(6); - $this->assertCarbon($d, 1975, 5, 24, 0, 0, 0); - } - - public function testNextTimestamp() - { - $d = Carbon::createFromDate(1975, 11, 14)->next(); - $this->assertCarbon($d, 1975, 11, 21, 0, 0, 0); - } - - public function testPrevious() - { - $d = Carbon::createFromDate(1975, 5, 21)->previous(); - $this->assertCarbon($d, 1975, 5, 14, 0, 0, 0); - } - - public function testPreviousMonday() - { - $d = Carbon::createFromDate(1975, 5, 21)->previous(Carbon::MONDAY); - $this->assertCarbon($d, 1975, 5, 19, 0, 0, 0); - } - - public function testPreviousSaturday() - { - $d = Carbon::createFromDate(1975, 5, 21)->previous(6); - $this->assertCarbon($d, 1975, 5, 17, 0, 0, 0); - } - - public function testPreviousTimestamp() - { - $d = Carbon::createFromDate(1975, 11, 28)->previous(); - $this->assertCarbon($d, 1975, 11, 21, 0, 0, 0); - } - - public function testFirstDayOfMonth() - { - $d = Carbon::createFromDate(1975, 11, 21)->firstOfMonth(); - $this->assertCarbon($d, 1975, 11, 1, 0, 0, 0); - } - - public function testFirstWednesdayOfMonth() - { - $d = Carbon::createFromDate(1975, 11, 21)->firstOfMonth(Carbon::WEDNESDAY); - $this->assertCarbon($d, 1975, 11, 5, 0, 0, 0); - } - - public function testFirstFridayOfMonth() - { - $d = Carbon::createFromDate(1975, 11, 21)->firstOfMonth(5); - $this->assertCarbon($d, 1975, 11, 7, 0, 0, 0); - } - - public function testLastDayOfMonth() - { - $d = Carbon::createFromDate(1975, 12, 5)->lastOfMonth(); - $this->assertCarbon($d, 1975, 12, 31, 0, 0, 0); - } - - public function testLastTuesdayOfMonth() - { - $d = Carbon::createFromDate(1975, 12, 1)->lastOfMonth(Carbon::TUESDAY); - $this->assertCarbon($d, 1975, 12, 30, 0, 0, 0); - } - - public function testLastFridayOfMonth() - { - $d = Carbon::createFromDate(1975, 12, 5)->lastOfMonth(5); - $this->assertCarbon($d, 1975, 12, 26, 0, 0, 0); - } - - public function testNthOfMonthOutsideScope() - { - $this->assertFalse(Carbon::createFromDate(1975, 12, 5)->nthOfMonth(6, Carbon::MONDAY)); - } - - public function testNthOfMonthOutsideYear() - { - $this->assertFalse(Carbon::createFromDate(1975, 12, 5)->nthOfMonth(55, Carbon::MONDAY)); - } - - public function test2ndMondayOfMonth() - { - $d = Carbon::createFromDate(1975, 12, 5)->nthOfMonth(2, Carbon::MONDAY); - $this->assertCarbon($d, 1975, 12, 8, 0, 0, 0); - } - - public function test3rdWednesdayOfMonth() - { - $d = Carbon::createFromDate(1975, 12, 5)->nthOfMonth(3, 3); - $this->assertCarbon($d, 1975, 12, 17, 0, 0, 0); - } - - public function testFirstDayOfQuarter() - { - $d = Carbon::createFromDate(1975, 11, 21)->firstOfQuarter(); - $this->assertCarbon($d, 1975, 10, 1, 0, 0, 0); - } - - public function testFirstWednesdayOfQuarter() - { - $d = Carbon::createFromDate(1975, 11, 21)->firstOfQuarter(Carbon::WEDNESDAY); - $this->assertCarbon($d, 1975, 10, 1, 0, 0, 0); - } - - public function testFirstFridayOfQuarter() - { - $d = Carbon::createFromDate(1975, 11, 21)->firstOfQuarter(5); - $this->assertCarbon($d, 1975, 10, 3, 0, 0, 0); - } - - public function testFirstOfQuarterFromADayThatWillNotExistIntheFirstMonth() - { - $d = Carbon::createFromDate(2014, 5, 31)->firstOfQuarter(); - $this->assertCarbon($d, 2014, 4, 1, 0, 0, 0); - } - - public function testLastDayOfQuarter() - { - $d = Carbon::createFromDate(1975, 8, 5)->lastOfQuarter(); - $this->assertCarbon($d, 1975, 9, 30, 0, 0, 0); - } - - public function testLastTuesdayOfQuarter() - { - $d = Carbon::createFromDate(1975, 8, 1)->lastOfQuarter(Carbon::TUESDAY); - $this->assertCarbon($d, 1975, 9, 30, 0, 0, 0); - } - - public function testLastFridayOfQuarter() - { - $d = Carbon::createFromDate(1975, 7, 5)->lastOfQuarter(5); - $this->assertCarbon($d, 1975, 9, 26, 0, 0, 0); - } - - public function testLastOfQuarterFromADayThatWillNotExistIntheLastMonth() - { - $d = Carbon::createFromDate(2014, 5, 31)->lastOfQuarter(); - $this->assertCarbon($d, 2014, 6, 30, 0, 0, 0); - } - - public function testNthOfQuarterOutsideScope() - { - $this->assertFalse(Carbon::createFromDate(1975, 1, 5)->nthOfQuarter(20, Carbon::MONDAY)); - } - - public function testNthOfQuarterOutsideYear() - { - $this->assertFalse(Carbon::createFromDate(1975, 1, 5)->nthOfQuarter(55, Carbon::MONDAY)); - } - - public function testNthOfQuarterFromADayThatWillNotExistIntheFirstMonth() - { - $d = Carbon::createFromDate(2014, 5, 31)->nthOfQuarter(2, Carbon::MONDAY); - $this->assertCarbon($d, 2014, 4, 14, 0, 0, 0); - } - - public function test2ndMondayOfQuarter() - { - $d = Carbon::createFromDate(1975, 8, 5)->nthOfQuarter(2, Carbon::MONDAY); - $this->assertCarbon($d, 1975, 7, 14, 0, 0, 0); - } - - public function test3rdWednesdayOfQuarter() - { - $d = Carbon::createFromDate(1975, 8, 5)->nthOfQuarter(3, 3); - $this->assertCarbon($d, 1975, 7, 16, 0, 0, 0); - } - - public function testFirstDayOfYear() - { - $d = Carbon::createFromDate(1975, 11, 21)->firstOfYear(); - $this->assertCarbon($d, 1975, 1, 1, 0, 0, 0); - } - - public function testFirstWednesdayOfYear() - { - $d = Carbon::createFromDate(1975, 11, 21)->firstOfYear(Carbon::WEDNESDAY); - $this->assertCarbon($d, 1975, 1, 1, 0, 0, 0); - } - - public function testFirstFridayOfYear() - { - $d = Carbon::createFromDate(1975, 11, 21)->firstOfYear(5); - $this->assertCarbon($d, 1975, 1, 3, 0, 0, 0); - } - - public function testLastDayOfYear() - { - $d = Carbon::createFromDate(1975, 8, 5)->lastOfYear(); - $this->assertCarbon($d, 1975, 12, 31, 0, 0, 0); - } - - public function testLastTuesdayOfYear() - { - $d = Carbon::createFromDate(1975, 8, 1)->lastOfYear(Carbon::TUESDAY); - $this->assertCarbon($d, 1975, 12, 30, 0, 0, 0); - } - - public function testLastFridayOfYear() - { - $d = Carbon::createFromDate(1975, 7, 5)->lastOfYear(5); - $this->assertCarbon($d, 1975, 12, 26, 0, 0, 0); - } - - public function testNthOfYearOutsideScope() - { - $this->assertFalse(Carbon::createFromDate(1975, 1, 5)->nthOfYear(55, Carbon::MONDAY)); - } - - public function test2ndMondayOfYear() - { - $d = Carbon::createFromDate(1975, 8, 5)->nthOfYear(2, Carbon::MONDAY); - $this->assertCarbon($d, 1975, 1, 13, 0, 0, 0); - } - - public function test3rdWednesdayOfYear() - { - $d = Carbon::createFromDate(1975, 8, 5)->nthOfYear(3, 3); - $this->assertCarbon($d, 1975, 1, 15, 0, 0, 0); - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/DiffTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/DiffTest.php b/vendor/nesbot/carbon/tests/DiffTest.php deleted file mode 100644 index cf44a59..0000000 --- a/vendor/nesbot/carbon/tests/DiffTest.php +++ /dev/null @@ -1,953 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class DiffTest extends TestFixture -{ - public function testDiffInYearsPositive() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(1, $dt->diffInYears($dt->copy()->addYear())); - } - - public function testDiffInYearsNegativeWithSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(-1, $dt->diffInYears($dt->copy()->subYear(), false)); - } - - public function testDiffInYearsNegativeNoSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(1, $dt->diffInYears($dt->copy()->subYear())); - } - - public function testDiffInYearsVsDefaultNow() - { - $this->assertSame(1, Carbon::now()->subYear()->diffInYears()); - } - - public function testDiffInYearsEnsureIsTruncated() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(1, $dt->diffInYears($dt->copy()->addYear()->addMonths(7))); - } - - public function testDiffInMonthsPositive() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(13, $dt->diffInMonths($dt->copy()->addYear()->addMonth())); - } - - public function testDiffInMonthsNegativeWithSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(-11, $dt->diffInMonths($dt->copy()->subYear()->addMonth(), false)); - } - - public function testDiffInMonthsNegativeNoSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(11, $dt->diffInMonths($dt->copy()->subYear()->addMonth())); - } - - public function testDiffInMonthsVsDefaultNow() - { - $this->assertSame(12, Carbon::now()->subYear()->diffInMonths()); - } - - public function testDiffInMonthsEnsureIsTruncated() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(1, $dt->diffInMonths($dt->copy()->addMonth()->addDays(16))); - } - - public function testDiffInDaysPositive() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(366, $dt->diffInDays($dt->copy()->addYear())); - } - - public function testDiffInDaysNegativeWithSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(-365, $dt->diffInDays($dt->copy()->subYear(), false)); - } - - public function testDiffInDaysNegativeNoSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(365, $dt->diffInDays($dt->copy()->subYear())); - } - - public function testDiffInDaysVsDefaultNow() - { - $this->assertSame(7, Carbon::now()->subWeek()->diffInDays()); - } - - public function testDiffInDaysEnsureIsTruncated() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(1, $dt->diffInDays($dt->copy()->addDay()->addHours(13))); - } - - public function testDiffInDaysFilteredPositiveWithMutated() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(5, $dt->diffInDaysFiltered(function (Carbon $date) { - return $date->dayOfWeek === 1; - }, $dt->copy()->endOfMonth())); - } - - public function testDiffInDaysFilteredPositiveWithSecondObject() - { - $dt1 = Carbon::createFromDate(2000, 1, 1); - $dt2 = Carbon::createFromDate(2000, 1, 31); - - $this->assertSame(5, $dt1->diffInDaysFiltered(function (Carbon $date) { - return $date->dayOfWeek === Carbon::SUNDAY; - }, $dt2)); - } - - public function testDiffInDaysFilteredNegativeNoSignWithMutated() - { - $dt = Carbon::createFromDate(2000, 1, 31); - $this->assertSame(5, $dt->diffInDaysFiltered(function (Carbon $date) { - return $date->dayOfWeek === Carbon::SUNDAY; - }, $dt->copy()->startOfMonth())); - } - - public function testDiffInDaysFilteredNegativeNoSignWithSecondObject() - { - $dt1 = Carbon::createFromDate(2000, 1, 31); - $dt2 = Carbon::createFromDate(2000, 1, 1); - - $this->assertSame(5, $dt1->diffInDaysFiltered(function (Carbon $date) { - return $date->dayOfWeek === Carbon::SUNDAY; - }, $dt2)); - } - - public function testDiffInDaysFilteredNegativeWithSignWithMutated() - { - $dt = Carbon::createFromDate(2000, 1, 31); - $this->assertSame(-5, $dt->diffInDaysFiltered(function (Carbon $date) { - return $date->dayOfWeek === 1; - }, $dt->copy()->startOfMonth(), false)); - } - - public function testDiffInDaysFilteredNegativeWithSignWithSecondObject() - { - $dt1 = Carbon::createFromDate(2000, 1, 31); - $dt2 = Carbon::createFromDate(2000, 1, 1); - - $this->assertSame(-5, $dt1->diffInDaysFiltered(function (Carbon $date) { - return $date->dayOfWeek === Carbon::SUNDAY; - }, $dt2, false)); - } - - public function testBug188DiffWithSameDates() - { - $start = Carbon::create(2014, 10, 8, 15, 20, 0); - $end = $start->copy(); - - $this->assertSame(0, $start->diffInDays($end)); - $this->assertSame(0, $start->diffInWeekdays($end)); - } - - public function testBug188DiffWithDatesOnlyHoursApart() - { - $start = Carbon::create(2014, 10, 8, 15, 20, 0); - $end = $start->copy(); - - $this->assertSame(0, $start->diffInDays($end)); - $this->assertSame(0, $start->diffInWeekdays($end)); - } - - public function testBug188DiffWithSameDates1DayApart() - { - $start = Carbon::create(2014, 10, 8, 15, 20, 0); - $end = $start->copy()->addDay(); - - $this->assertSame(1, $start->diffInDays($end)); - $this->assertSame(1, $start->diffInWeekdays($end)); - } - - public function testBug188DiffWithDatesOnTheWeekend() - { - $start = Carbon::create(2014, 1, 1, 0, 0, 0); - $start->next(Carbon::SATURDAY); - $end = $start->copy()->addDay(); - - $this->assertSame(1, $start->diffInDays($end)); - $this->assertSame(0, $start->diffInWeekdays($end)); - } - - public function testDiffInWeekdaysPositive() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(21, $dt->diffInWeekdays($dt->copy()->endOfMonth())); - } - - public function testDiffInWeekdaysNegativeNoSign() - { - $dt = Carbon::createFromDate(2000, 1, 31); - $this->assertSame(21, $dt->diffInWeekdays($dt->copy()->startOfMonth())); - } - - public function testDiffInWeekdaysNegativeWithSign() - { - $dt = Carbon::createFromDate(2000, 1, 31); - $this->assertSame(-21, $dt->diffInWeekdays($dt->copy()->startOfMonth(), false)); - } - - public function testDiffInWeekendDaysPositive() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(10, $dt->diffInWeekendDays($dt->copy()->endOfMonth())); - } - - public function testDiffInWeekendDaysNegativeNoSign() - { - $dt = Carbon::createFromDate(2000, 1, 31); - $this->assertSame(10, $dt->diffInWeekendDays($dt->copy()->startOfMonth())); - } - - public function testDiffInWeekendDaysNegativeWithSign() - { - $dt = Carbon::createFromDate(2000, 1, 31); - $this->assertSame(-10, $dt->diffInWeekendDays($dt->copy()->startOfMonth(), false)); - } - - public function testDiffInWeeksPositive() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(52, $dt->diffInWeeks($dt->copy()->addYear())); - } - - public function testDiffInWeeksNegativeWithSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(-52, $dt->diffInWeeks($dt->copy()->subYear(), false)); - } - - public function testDiffInWeeksNegativeNoSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(52, $dt->diffInWeeks($dt->copy()->subYear())); - } - - public function testDiffInWeeksVsDefaultNow() - { - $this->assertSame(1, Carbon::now()->subWeek()->diffInWeeks()); - } - - public function testDiffInWeeksEnsureIsTruncated() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(0, $dt->diffInWeeks($dt->copy()->addWeek()->subDay())); - } - - public function testDiffInHoursPositive() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(26, $dt->diffInHours($dt->copy()->addDay()->addHours(2))); - } - - public function testDiffInHoursNegativeWithSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(-22, $dt->diffInHours($dt->copy()->subDay()->addHours(2), false)); - } - - public function testDiffInHoursNegativeNoSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(22, $dt->diffInHours($dt->copy()->subDay()->addHours(2))); - } - - public function testDiffInHoursVsDefaultNow() - { - Carbon::setTestNow(Carbon::create(2012, 1, 15)); - $this->assertSame(48, Carbon::now()->subDays(2)->diffInHours()); - Carbon::setTestNow(); - } - - public function testDiffInHoursEnsureIsTruncated() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(1, $dt->diffInHours($dt->copy()->addHour()->addMinutes(31))); - } - - public function testDiffInMinutesPositive() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(62, $dt->diffInMinutes($dt->copy()->addHour()->addMinutes(2))); - } - - public function testDiffInMinutesPositiveAlot() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(1502, $dt->diffInMinutes($dt->copy()->addHours(25)->addMinutes(2))); - } - - public function testDiffInMinutesNegativeWithSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(-58, $dt->diffInMinutes($dt->copy()->subHour()->addMinutes(2), false)); - } - - public function testDiffInMinutesNegativeNoSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(58, $dt->diffInMinutes($dt->copy()->subHour()->addMinutes(2))); - } - - public function testDiffInMinutesVsDefaultNow() - { - $this->assertSame(60, Carbon::now()->subHour()->diffInMinutes()); - } - - public function testDiffInMinutesEnsureIsTruncated() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(1, $dt->diffInMinutes($dt->copy()->addMinute()->addSeconds(31))); - } - - public function testDiffInSecondsPositive() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(62, $dt->diffInSeconds($dt->copy()->addMinute()->addSeconds(2))); - } - - public function testDiffInSecondsPositiveAlot() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(7202, $dt->diffInSeconds($dt->copy()->addHours(2)->addSeconds(2))); - } - - public function testDiffInSecondsNegativeWithSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(-58, $dt->diffInSeconds($dt->copy()->subMinute()->addSeconds(2), false)); - } - - public function testDiffInSecondsNegativeNoSign() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(58, $dt->diffInSeconds($dt->copy()->subMinute()->addSeconds(2))); - } - - public function testDiffInSecondsVsDefaultNow() - { - $this->assertSame(3600, Carbon::now()->subHour()->diffInSeconds()); - } - - public function testDiffInSecondsEnsureIsTruncated() - { - $dt = Carbon::createFromDate(2000, 1, 1); - $this->assertSame(1, $dt->diffInSeconds($dt->copy()->addSeconds(1.9))); - } - - public function testDiffInSecondsWithTimezones() - { - $dtOttawa = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); - $dtVancouver = Carbon::createFromDate(2000, 1, 1, 'America/Vancouver'); - $this->assertSame(3 * 60 * 60, $dtOttawa->diffInSeconds($dtVancouver)); - } - - public function testDiffInSecondsWithTimezonesAndVsDefault() - { - $dt = Carbon::now('America/Vancouver'); - $this->assertSame(0, $dt->diffInSeconds()); - } - - public function testDiffForHumansNowAndSecond() - { - $d = Carbon::now(); - $this->assertSame('1 second ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndSecondWithTimezone() - { - $d = Carbon::now('America/Vancouver'); - $this->assertSame('1 second ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndSeconds() - { - $d = Carbon::now()->subSeconds(2); - $this->assertSame('2 seconds ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndNearlyMinute() - { - $d = Carbon::now()->subSeconds(59); - $this->assertSame('59 seconds ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndMinute() - { - $d = Carbon::now()->subMinute(); - $this->assertSame('1 minute ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndMinutes() - { - $d = Carbon::now()->subMinutes(2); - $this->assertSame('2 minutes ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndNearlyHour() - { - $d = Carbon::now()->subMinutes(59); - $this->assertSame('59 minutes ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndHour() - { - $d = Carbon::now()->subHour(); - $this->assertSame('1 hour ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndHours() - { - Carbon::setTestNow(Carbon::create(2012, 1, 15)); - $d = Carbon::now()->subHours(2); - $this->assertSame('2 hours ago', $d->diffForHumans()); - Carbon::setTestNow(); - } - - public function testDiffForHumansNowAndNearlyDay() - { - Carbon::setTestNow(Carbon::create(2012, 1, 15)); - $d = Carbon::now()->subHours(23); - $this->assertSame('23 hours ago', $d->diffForHumans()); - Carbon::setTestNow(); - } - - public function testDiffForHumansNowAndDay() - { - $d = Carbon::now()->subDay(); - $this->assertSame('1 day ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndDays() - { - $d = Carbon::now()->subDays(2); - $this->assertSame('2 days ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndNearlyWeek() - { - $d = Carbon::now()->subDays(6); - $this->assertSame('6 days ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndWeek() - { - $d = Carbon::now()->subWeek(); - $this->assertSame('1 week ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndWeeks() - { - $d = Carbon::now()->subWeeks(2); - $this->assertSame('2 weeks ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndNearlyMonth() - { - $d = Carbon::now()->subWeeks(3); - $this->assertSame('3 weeks ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndMonth() - { - Carbon::setTestNow(Carbon::create(2012, 1, 1)); - $d = Carbon::now()->subWeeks(4); - $this->assertSame('4 weeks ago', $d->diffForHumans()); - $d = Carbon::now()->subMonth(); - $this->assertSame('1 month ago', $d->diffForHumans()); - Carbon::setTestNow(); - } - - public function testDiffForHumansNowAndMonths() - { - $d = Carbon::now()->subMonths(2); - $this->assertSame('2 months ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndNearlyYear() - { - $d = Carbon::now()->subMonths(11); - $this->assertSame('11 months ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndYear() - { - $d = Carbon::now()->subYear(); - $this->assertSame('1 year ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndYears() - { - $d = Carbon::now()->subYears(2); - $this->assertSame('2 years ago', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndFutureSecond() - { - $d = Carbon::now()->addSecond(); - $this->assertSame('1 second from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndFutureSeconds() - { - $d = Carbon::now()->addSeconds(2); - $this->assertSame('2 seconds from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndNearlyFutureMinute() - { - $d = Carbon::now()->addSeconds(59); - $this->assertSame('59 seconds from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndFutureMinute() - { - $d = Carbon::now()->addMinute(); - $this->assertSame('1 minute from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndFutureMinutes() - { - $d = Carbon::now()->addMinutes(2); - $this->assertSame('2 minutes from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndNearlyFutureHour() - { - $d = Carbon::now()->addMinutes(59); - $this->assertSame('59 minutes from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndFutureHour() - { - $d = Carbon::now()->addHour(); - $this->assertSame('1 hour from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndFutureHours() - { - $d = Carbon::now()->addHours(2); - $this->assertSame('2 hours from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndNearlyFutureDay() - { - Carbon::setTestNow(Carbon::create(2012, 1, 1)); - $d = Carbon::now()->addHours(23); - $this->assertSame('23 hours from now', $d->diffForHumans()); - Carbon::setTestNow(); - } - - public function testDiffForHumansNowAndFutureDay() - { - $d = Carbon::now()->addDay(); - $this->assertSame('1 day from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndFutureDays() - { - $d = Carbon::now()->addDays(2); - $this->assertSame('2 days from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndNearlyFutureWeek() - { - $d = Carbon::now()->addDays(6); - $this->assertSame('6 days from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndFutureWeek() - { - $d = Carbon::now()->addWeek(); - $this->assertSame('1 week from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndFutureWeeks() - { - $d = Carbon::now()->addWeeks(2); - $this->assertSame('2 weeks from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndNearlyFutureMonth() - { - $d = Carbon::now()->addWeeks(3); - $this->assertSame('3 weeks from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndFutureMonth() - { - Carbon::setTestNow(Carbon::create(2012, 1, 1)); - $d = Carbon::now()->addWeeks(4); - $this->assertSame('4 weeks from now', $d->diffForHumans()); - $d = Carbon::now()->addMonth(); - $this->assertSame('1 month from now', $d->diffForHumans()); - Carbon::setTestNow(); - } - - public function testDiffForHumansNowAndFutureMonths() - { - Carbon::setTestNow(Carbon::create(2012, 1, 1)); - $d = Carbon::now()->addMonths(2); - $this->assertSame('2 months from now', $d->diffForHumans()); - Carbon::setTestNow(); - } - - public function testDiffForHumansNowAndNearlyFutureYear() - { - $d = Carbon::now()->addMonths(11); - $this->assertSame('11 months from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndFutureYear() - { - $d = Carbon::now()->addYear(); - $this->assertSame('1 year from now', $d->diffForHumans()); - } - - public function testDiffForHumansNowAndFutureYears() - { - $d = Carbon::now()->addYears(2); - $this->assertSame('2 years from now', $d->diffForHumans()); - } - - public function testDiffForHumansOtherAndSecond() - { - $d = Carbon::now()->addSecond(); - $this->assertSame('1 second before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndSeconds() - { - $d = Carbon::now()->addSeconds(2); - $this->assertSame('2 seconds before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndNearlyMinute() - { - $d = Carbon::now()->addSeconds(59); - $this->assertSame('59 seconds before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndMinute() - { - $d = Carbon::now()->addMinute(); - $this->assertSame('1 minute before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndMinutes() - { - $d = Carbon::now()->addMinutes(2); - $this->assertSame('2 minutes before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndNearlyHour() - { - $d = Carbon::now()->addMinutes(59); - $this->assertSame('59 minutes before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndHour() - { - $d = Carbon::now()->addHour(); - $this->assertSame('1 hour before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndHours() - { - $d = Carbon::now()->addHours(2); - $this->assertSame('2 hours before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndNearlyDay() - { - Carbon::setTestNow(Carbon::create(2012, 1, 1)); - $d = Carbon::now()->addHours(23); - $this->assertSame('23 hours before', Carbon::now()->diffForHumans($d)); - Carbon::setTestNow(); - } - - public function testDiffForHumansOtherAndDay() - { - $d = Carbon::now()->addDay(); - $this->assertSame('1 day before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndDays() - { - $d = Carbon::now()->addDays(2); - $this->assertSame('2 days before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndNearlyWeek() - { - $d = Carbon::now()->addDays(6); - $this->assertSame('6 days before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndWeek() - { - $d = Carbon::now()->addWeek(); - $this->assertSame('1 week before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndWeeks() - { - $d = Carbon::now()->addWeeks(2); - $this->assertSame('2 weeks before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndNearlyMonth() - { - $d = Carbon::now()->addWeeks(3); - $this->assertSame('3 weeks before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndMonth() - { - Carbon::setTestNow(Carbon::create(2012, 1, 1)); - $d = Carbon::now()->addWeeks(4); - $this->assertSame('4 weeks before', Carbon::now()->diffForHumans($d)); - $d = Carbon::now()->addMonth(); - $this->assertSame('1 month before', Carbon::now()->diffForHumans($d)); - Carbon::setTestNow(); - } - - public function testDiffForHumansOtherAndMonths() - { - Carbon::setTestNow(Carbon::create(2012, 1, 1)); - $d = Carbon::now()->addMonths(2); - $this->assertSame('2 months before', Carbon::now()->diffForHumans($d)); - Carbon::setTestNow(); - } - - public function testDiffForHumansOtherAndNearlyYear() - { - $d = Carbon::now()->addMonths(11); - $this->assertSame('11 months before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndYear() - { - $d = Carbon::now()->addYear(); - $this->assertSame('1 year before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndYears() - { - $d = Carbon::now()->addYears(2); - $this->assertSame('2 years before', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndFutureSecond() - { - $d = Carbon::now()->subSecond(); - $this->assertSame('1 second after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndFutureSeconds() - { - $d = Carbon::now()->subSeconds(2); - $this->assertSame('2 seconds after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndNearlyFutureMinute() - { - $d = Carbon::now()->subSeconds(59); - $this->assertSame('59 seconds after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndFutureMinute() - { - $d = Carbon::now()->subMinute(); - $this->assertSame('1 minute after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndFutureMinutes() - { - $d = Carbon::now()->subMinutes(2); - $this->assertSame('2 minutes after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndNearlyFutureHour() - { - $d = Carbon::now()->subMinutes(59); - $this->assertSame('59 minutes after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndFutureHour() - { - $d = Carbon::now()->subHour(); - $this->assertSame('1 hour after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndFutureHours() - { - $d = Carbon::now()->subHours(2); - $this->assertSame('2 hours after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndNearlyFutureDay() - { - Carbon::setTestNow(Carbon::create(2012, 1, 15)); - $d = Carbon::now()->subHours(23); - $this->assertSame('23 hours after', Carbon::now()->diffForHumans($d)); - Carbon::setTestNow(); - } - - public function testDiffForHumansOtherAndFutureDay() - { - $d = Carbon::now()->subDay(); - $this->assertSame('1 day after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndFutureDays() - { - $d = Carbon::now()->subDays(2); - $this->assertSame('2 days after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndNearlyFutureWeek() - { - $d = Carbon::now()->subDays(6); - $this->assertSame('6 days after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndFutureWeek() - { - $d = Carbon::now()->subWeek(); - $this->assertSame('1 week after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndFutureWeeks() - { - $d = Carbon::now()->subWeeks(2); - $this->assertSame('2 weeks after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndNearlyFutureMonth() - { - $d = Carbon::now()->subWeeks(3); - $this->assertSame('3 weeks after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndFutureMonth() - { - Carbon::setTestNow(Carbon::create(2012, 1, 1)); - $d = Carbon::now()->subWeeks(4); - $this->assertSame('4 weeks after', Carbon::now()->diffForHumans($d)); - $d = Carbon::now()->subMonth(); - $this->assertSame('1 month after', Carbon::now()->diffForHumans($d)); - Carbon::setTestNow(); - } - - public function testDiffForHumansOtherAndFutureMonths() - { - $d = Carbon::now()->subMonths(2); - $this->assertSame('2 months after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndNearlyFutureYear() - { - $d = Carbon::now()->subMonths(11); - $this->assertSame('11 months after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndFutureYear() - { - $d = Carbon::now()->subYear(); - $this->assertSame('1 year after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansOtherAndFutureYears() - { - $d = Carbon::now()->subYears(2); - $this->assertSame('2 years after', Carbon::now()->diffForHumans($d)); - } - - public function testDiffForHumansAbsoluteSeconds() - { - $d = Carbon::now()->subSeconds(59); - $this->assertSame('59 seconds', Carbon::now()->diffForHumans($d, true)); - $d = Carbon::now()->addSeconds(59); - $this->assertSame('59 seconds', Carbon::now()->diffForHumans($d, true)); - } - - public function testDiffForHumansAbsoluteMinutes() - { - $d = Carbon::now()->subMinutes(30); - $this->assertSame('30 minutes', Carbon::now()->diffForHumans($d, true)); - $d = Carbon::now()->addMinutes(30); - $this->assertSame('30 minutes', Carbon::now()->diffForHumans($d, true)); - } - - public function testDiffForHumansAbsoluteHours() - { - $d = Carbon::now()->subHours(3); - $this->assertSame('3 hours', Carbon::now()->diffForHumans($d, true)); - $d = Carbon::now()->addHours(3); - $this->assertSame('3 hours', Carbon::now()->diffForHumans($d, true)); - } - - public function testDiffForHumansAbsoluteDays() - { - $d = Carbon::now()->subDays(2); - $this->assertSame('2 days', Carbon::now()->diffForHumans($d, true)); - $d = Carbon::now()->addDays(2); - $this->assertSame('2 days', Carbon::now()->diffForHumans($d, true)); - } - - public function testDiffForHumansAbsoluteWeeks() - { - $d = Carbon::now()->subWeeks(2); - $this->assertSame('2 weeks', Carbon::now()->diffForHumans($d, true)); - $d = Carbon::now()->addWeeks(2); - $this->assertSame('2 weeks', Carbon::now()->diffForHumans($d, true)); - } - - public function testDiffForHumansAbsoluteMonths() - { - Carbon::setTestNow(Carbon::create(2012, 1, 1)); - $d = Carbon::now()->subMonths(2); - $this->assertSame('2 months', Carbon::now()->diffForHumans($d, true)); - $d = Carbon::now()->addMonths(2); - $this->assertSame('2 months', Carbon::now()->diffForHumans($d, true)); - Carbon::setTestNow(); - } - - public function testDiffForHumansAbsoluteYears() - { - $d = Carbon::now()->subYears(1); - $this->assertSame('1 year', Carbon::now()->diffForHumans($d, true)); - $d = Carbon::now()->addYears(1); - $this->assertSame('1 year', Carbon::now()->diffForHumans($d, true)); - } - - public function testDiffForHumansWithShorterMonthShouldStillBeAMonth() - { - $feb15 = Carbon::parse('2015-02-15'); - $mar15 = Carbon::parse('2015-03-15'); - $this->assertSame('1 month after', $mar15->diffForHumans($feb15)); - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/FluidSettersTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/FluidSettersTest.php b/vendor/nesbot/carbon/tests/FluidSettersTest.php deleted file mode 100644 index 3ec1264..0000000 --- a/vendor/nesbot/carbon/tests/FluidSettersTest.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class FluidSettersTest extends TestFixture -{ - public function testFluidYearSetter() - { - $d = Carbon::now(); - $this->assertTrue($d->year(1995) instanceof Carbon); - $this->assertSame(1995, $d->year); - } - - public function testFluidMonthSetter() - { - $d = Carbon::now(); - $this->assertTrue($d->month(3) instanceof Carbon); - $this->assertSame(3, $d->month); - } - - public function testFluidMonthSetterWithWrap() - { - $d = Carbon::createFromDate(2012, 8, 21); - $this->assertTrue($d->month(13) instanceof Carbon); - $this->assertSame(1, $d->month); - } - - public function testFluidDaySetter() - { - $d = Carbon::now(); - $this->assertTrue($d->day(2) instanceof Carbon); - $this->assertSame(2, $d->day); - } - - public function testFluidDaySetterWithWrap() - { - $d = Carbon::createFromDate(2000, 1, 1); - $this->assertTrue($d->day(32) instanceof Carbon); - $this->assertSame(1, $d->day); - } - - public function testFluidSetDate() - { - $d = Carbon::createFromDate(2000, 1, 1); - $this->assertTrue($d->setDate(1995, 13, 32) instanceof Carbon); - $this->assertCarbon($d, 1996, 2, 1); - } - - public function testFluidHourSetter() - { - $d = Carbon::now(); - $this->assertTrue($d->hour(2) instanceof Carbon); - $this->assertSame(2, $d->hour); - } - - public function testFluidHourSetterWithWrap() - { - $d = Carbon::now(); - $this->assertTrue($d->hour(25) instanceof Carbon); - $this->assertSame(1, $d->hour); - } - - public function testFluidMinuteSetter() - { - $d = Carbon::now(); - $this->assertTrue($d->minute(2) instanceof Carbon); - $this->assertSame(2, $d->minute); - } - - public function testFluidMinuteSetterWithWrap() - { - $d = Carbon::now(); - $this->assertTrue($d->minute(61) instanceof Carbon); - $this->assertSame(1, $d->minute); - } - - public function testFluidSecondSetter() - { - $d = Carbon::now(); - $this->assertTrue($d->second(2) instanceof Carbon); - $this->assertSame(2, $d->second); - } - - public function testFluidSecondSetterWithWrap() - { - $d = Carbon::now(); - $this->assertTrue($d->second(62) instanceof Carbon); - $this->assertSame(2, $d->second); - } - - public function testFluidSetTime() - { - $d = Carbon::createFromDate(2000, 1, 1); - $this->assertTrue($d->setTime(25, 61, 61) instanceof Carbon); - $this->assertCarbon($d, 2000, 1, 2, 2, 2, 1); - } - - public function testFluidTimestampSetter() - { - $d = Carbon::now(); - $this->assertTrue($d->timestamp(10) instanceof Carbon); - $this->assertSame(10, $d->timestamp); - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/GettersTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/GettersTest.php b/vendor/nesbot/carbon/tests/GettersTest.php deleted file mode 100644 index fca8942..0000000 --- a/vendor/nesbot/carbon/tests/GettersTest.php +++ /dev/null @@ -1,285 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class GettersTest extends TestFixture -{ - public function testGettersThrowExceptionOnUnknownGetter() - { - $this->setExpectedException('InvalidArgumentException'); - Carbon::create(1234, 5, 6, 7, 8, 9)->sdfsdfss; - } - - public function testYearGetter() - { - $d = Carbon::create(1234, 5, 6, 7, 8, 9); - $this->assertSame(1234, $d->year); - } - - public function testYearIsoGetter() - { - $d = Carbon::createFromDate(2012, 12, 31); - $this->assertSame(2013, $d->yearIso); - } - - public function testMonthGetter() - { - $d = Carbon::create(1234, 5, 6, 7, 8, 9); - $this->assertSame(5, $d->month); - } - - public function testDayGetter() - { - $d = Carbon::create(1234, 5, 6, 7, 8, 9); - $this->assertSame(6, $d->day); - } - - public function testHourGetter() - { - $d = Carbon::create(1234, 5, 6, 7, 8, 9); - $this->assertSame(7, $d->hour); - } - - public function testMinuteGetter() - { - $d = Carbon::create(1234, 5, 6, 7, 8, 9); - $this->assertSame(8, $d->minute); - } - - public function testSecondGetter() - { - $d = Carbon::create(1234, 5, 6, 7, 8, 9); - $this->assertSame(9, $d->second); - } - - public function testMicroGetter() - { - $micro = 345678; - $d = Carbon::parse('2014-01-05 12:34:11.'.$micro); - $this->assertSame($micro, $d->micro); - } - - public function testMicroGetterWithDefaultNow() - { - $d = Carbon::now(); - $this->assertSame(0, $d->micro); - } - - public function testDayOfWeeGetter() - { - $d = Carbon::create(2012, 5, 7, 7, 8, 9); - $this->assertSame(Carbon::MONDAY, $d->dayOfWeek); - } - - public function testDayOfYearGetter() - { - $d = Carbon::createFromDate(2012, 5, 7); - $this->assertSame(127, $d->dayOfYear); - } - - public function testDaysInMonthGetter() - { - $d = Carbon::createFromDate(2012, 5, 7); - $this->assertSame(31, $d->daysInMonth); - } - - public function testTimestampGetter() - { - $d = Carbon::create(); - $d->setTimezone('GMT'); - $this->assertSame(0, $d->setDateTime(1970, 1, 1, 0, 0, 0)->timestamp); - } - - public function testGetAge() - { - $d = Carbon::now(); - $this->assertSame(0, $d->age); - } - - public function testGetAgeWithRealAge() - { - $d = Carbon::createFromDate(1975, 5, 21); - $age = intval(substr(date('Ymd') - date('Ymd', $d->timestamp), 0, -4)); - - $this->assertSame($age, $d->age); - } - - public function testGetQuarterFirst() - { - $d = Carbon::createFromDate(2012, 1, 1); - $this->assertSame(1, $d->quarter); - } - - public function testGetQuarterFirstEnd() - { - $d = Carbon::createFromDate(2012, 3, 31); - $this->assertSame(1, $d->quarter); - } - - public function testGetQuarterSecond() - { - $d = Carbon::createFromDate(2012, 4, 1); - $this->assertSame(2, $d->quarter); - } - - public function testGetQuarterThird() - { - $d = Carbon::createFromDate(2012, 7, 1); - $this->assertSame(3, $d->quarter); - } - - public function testGetQuarterFourth() - { - $d = Carbon::createFromDate(2012, 10, 1); - $this->assertSame(4, $d->quarter); - } - - public function testGetQuarterFirstLast() - { - $d = Carbon::createFromDate(2012, 12, 31); - $this->assertSame(4, $d->quarter); - } - - public function testGetLocalTrue() - { - // Default timezone has been set to America/Toronto in TestFixture.php - // @see : http://en.wikipedia.org/wiki/List_of_UTC_time_offsets - $this->assertTrue(Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->local); - $this->assertTrue(Carbon::createFromDate(2012, 1, 1, 'America/New_York')->local); - } - - public function testGetLocalFalse() - { - $this->assertFalse(Carbon::createFromDate(2012, 7, 1, 'UTC')->local); - $this->assertFalse(Carbon::createFromDate(2012, 7, 1, 'Europe/London')->local); - } - - public function testGetUtcFalse() - { - $this->assertFalse(Carbon::createFromDate(2013, 1, 1, 'America/Toronto')->utc); - $this->assertFalse(Carbon::createFromDate(2013, 1, 1, 'Europe/Paris')->utc); - } - - public function testGetUtcTrue() - { - $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Atlantic/Reykjavik')->utc); - $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Europe/Lisbon')->utc); - $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Africa/Casablanca')->utc); - $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Africa/Dakar')->utc); - $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Europe/Dublin')->utc); - $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'Europe/London')->utc); - $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'UTC')->utc); - $this->assertTrue(Carbon::createFromDate(2013, 1, 1, 'GMT')->utc); - } - - public function testGetDstFalse() - { - $this->assertFalse(Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->dst); - } - - public function testGetDstTrue() - { - $this->assertTrue(Carbon::createFromDate(2012, 7, 1, 'America/Toronto')->dst); - } - - public function testOffsetForTorontoWithDST() - { - $this->assertSame(-18000, Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->offset); - } - - public function testOffsetForTorontoNoDST() - { - $this->assertSame(-14400, Carbon::createFromDate(2012, 6, 1, 'America/Toronto')->offset); - } - - public function testOffsetForGMT() - { - $this->assertSame(0, Carbon::createFromDate(2012, 6, 1, 'GMT')->offset); - } - - public function testOffsetHoursForTorontoWithDST() - { - $this->assertSame(-5, Carbon::createFromDate(2012, 1, 1, 'America/Toronto')->offsetHours); - } - - public function testOffsetHoursForTorontoNoDST() - { - $this->assertSame(-4, Carbon::createFromDate(2012, 6, 1, 'America/Toronto')->offsetHours); - } - - public function testOffsetHoursForGMT() - { - $this->assertSame(0, Carbon::createFromDate(2012, 6, 1, 'GMT')->offsetHours); - } - - public function testIsLeapYearTrue() - { - $this->assertTrue(Carbon::createFromDate(2012, 1, 1)->isLeapYear()); - } - - public function testIsLeapYearFalse() - { - $this->assertFalse(Carbon::createFromDate(2011, 1, 1)->isLeapYear()); - } - - public function testWeekOfMonth() - { - $this->assertSame(5, Carbon::createFromDate(2012, 9, 30)->weekOfMonth); - $this->assertSame(4, Carbon::createFromDate(2012, 9, 28)->weekOfMonth); - $this->assertSame(3, Carbon::createFromDate(2012, 9, 20)->weekOfMonth); - $this->assertSame(2, Carbon::createFromDate(2012, 9, 8)->weekOfMonth); - $this->assertSame(1, Carbon::createFromDate(2012, 9, 1)->weekOfMonth); - } - - public function testWeekOfYearFirstWeek() - { - $this->assertSame(52, Carbon::createFromDate(2012, 1, 1)->weekOfYear); - $this->assertSame(1, Carbon::createFromDate(2012, 1, 2)->weekOfYear); - } - - public function testWeekOfYearLastWeek() - { - $this->assertSame(52, Carbon::createFromDate(2012, 12, 30)->weekOfYear); - $this->assertSame(1, Carbon::createFromDate(2012, 12, 31)->weekOfYear); - } - - public function testGetTimezone() - { - $dt = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); - $this->assertSame('America/Toronto', $dt->timezone->getName()); - } - - public function testGetTz() - { - $dt = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); - $this->assertSame('America/Toronto', $dt->tz->getName()); - } - - public function testGetTimezoneName() - { - $dt = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); - $this->assertSame('America/Toronto', $dt->timezoneName); - } - - public function testGetTzName() - { - $dt = Carbon::createFromDate(2000, 1, 1, 'America/Toronto'); - $this->assertSame('America/Toronto', $dt->tzName); - } - - public function testInvalidGetter() - { - $this->setExpectedException('InvalidArgumentException'); - $d = Carbon::now(); - $bb = $d->doesNotExit; - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/InstanceTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/InstanceTest.php b/vendor/nesbot/carbon/tests/InstanceTest.php deleted file mode 100644 index d2d1c35..0000000 --- a/vendor/nesbot/carbon/tests/InstanceTest.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class InstanceTest extends TestFixture -{ - public function testInstanceFromDateTime() - { - $dating = Carbon::instance(\DateTime::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11')); - $this->assertCarbon($dating, 1975, 5, 21, 22, 32, 11); - } - - public function testInstanceFromDateTimeKeepsTimezoneName() - { - $dating = Carbon::instance(\DateTime::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11')->setTimezone(new \DateTimeZone('America/Vancouver'))); - $this->assertSame('America/Vancouver', $dating->tzName); - } - - public function testInstanceFromDateTimeKeepsMicros() - { - $micro = 254687; - $datetime = \DateTime::createFromFormat('Y-m-d H:i:s.u', '2014-02-01 03:45:27.'.$micro); - $carbon = Carbon::instance($datetime); - $this->assertSame($micro, $carbon->micro); - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/IsTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/IsTest.php b/vendor/nesbot/carbon/tests/IsTest.php deleted file mode 100644 index bc098ad..0000000 --- a/vendor/nesbot/carbon/tests/IsTest.php +++ /dev/null @@ -1,133 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class IsTest extends TestFixture -{ - public function testIsWeekdayTrue() - { - $this->assertTrue(Carbon::createFromDate(2012, 1, 2)->isWeekday()); - } - - public function testIsWeekdayFalse() - { - $this->assertFalse(Carbon::createFromDate(2012, 1, 1)->isWeekday()); - } - - public function testIsWeekendTrue() - { - $this->assertTrue(Carbon::createFromDate(2012, 1, 1)->isWeekend()); - } - - public function testIsWeekendFalse() - { - $this->assertFalse(Carbon::createFromDate(2012, 1, 2)->isWeekend()); - } - - public function testIsYesterdayTrue() - { - $this->assertTrue(Carbon::now()->subDay()->isYesterday()); - } - - public function testIsYesterdayFalseWithToday() - { - $this->assertFalse(Carbon::now()->endOfDay()->isYesterday()); - } - - public function testIsYesterdayFalseWith2Days() - { - $this->assertFalse(Carbon::now()->subDays(2)->startOfDay()->isYesterday()); - } - - public function testIsTodayTrue() - { - $this->assertTrue(Carbon::now()->isToday()); - } - - public function testIsTodayFalseWithYesterday() - { - $this->assertFalse(Carbon::now()->subDay()->endOfDay()->isToday()); - } - - public function testIsTodayFalseWithTomorrow() - { - $this->assertFalse(Carbon::now()->addDay()->startOfDay()->isToday()); - } - - public function testIsTodayWithTimezone() - { - $this->assertTrue(Carbon::now('Asia/Tokyo')->isToday()); - } - - public function testIsTomorrowTrue() - { - $this->assertTrue(Carbon::now()->addDay()->isTomorrow()); - } - - public function testIsTomorrowFalseWithToday() - { - $this->assertFalse(Carbon::now()->endOfDay()->isTomorrow()); - } - - public function testIsTomorrowFalseWith2Days() - { - $this->assertFalse(Carbon::now()->addDays(2)->startOfDay()->isTomorrow()); - } - - public function testIsFutureTrue() - { - $this->assertTrue(Carbon::now()->addSecond()->isFuture()); - } - - public function testIsFutureFalse() - { - $this->assertFalse(Carbon::now()->isFuture()); - } - - public function testIsFutureFalseInThePast() - { - $this->assertFalse(Carbon::now()->subSecond()->isFuture()); - } - - public function testIsPastTrue() - { - $this->assertTrue(Carbon::now()->subSecond()->isPast()); - } - - public function testIsPastFalse() - { - $this->assertFalse(Carbon::now()->addSecond()->isPast()); - $this->assertFalse(Carbon::now()->isPast()); - } - - public function testIsLeapYearTrue() - { - $this->assertTrue(Carbon::createFromDate(2016, 1, 1)->isLeapYear()); - } - - public function testIsLeapYearFalse() - { - $this->assertFalse(Carbon::createFromDate(2014, 1, 1)->isLeapYear()); - } - - public function testIsSameDayTrue() - { - $current = Carbon::createFromDate(2012, 1, 2); - $this->assertTrue($current->isSameDay(Carbon::createFromDate(2012, 1, 2))); - } - - public function testIsSameDayFalse() - { - $current = Carbon::createFromDate(2012, 1, 2); - $this->assertFalse($current->isSameDay(Carbon::createFromDate(2012, 1, 3))); - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/IssetTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/IssetTest.php b/vendor/nesbot/carbon/tests/IssetTest.php deleted file mode 100644 index 5ca8076..0000000 --- a/vendor/nesbot/carbon/tests/IssetTest.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class IssetTest extends TestFixture -{ - public function testIssetReturnFalseForUnknownProperty() - { - $this->assertFalse(isset(Carbon::create(1234, 5, 6, 7, 8, 9)->sdfsdfss)); - } - - public function testIssetReturnTrueForProperties() - { - $properties = array( - 'year', - 'month', - 'day', - 'hour', - 'minute', - 'second', - 'dayOfWeek', - 'dayOfYear', - 'daysInMonth', - 'timestamp', - 'age', - 'quarter', - 'dst', - 'offset', - 'offsetHours', - 'timezone', - 'timezoneName', - 'tz', - 'tzName' - ); - - foreach ($properties as $property) { - $this->assertTrue(isset(Carbon::create(1234, 5, 6, 7, 8, 9)->$property)); - } - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/NowAndOtherStaticHelpersTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/NowAndOtherStaticHelpersTest.php b/vendor/nesbot/carbon/tests/NowAndOtherStaticHelpersTest.php deleted file mode 100644 index 7e7bdb9..0000000 --- a/vendor/nesbot/carbon/tests/NowAndOtherStaticHelpersTest.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class NowAndOtherStaticHelpersTest extends TestFixture -{ - public function testNow() - { - $dt = Carbon::now(); - $this->assertSame(time(), $dt->timestamp); - } - - public function testNowWithTimezone() - { - $dt = Carbon::now('Europe/London'); - $this->assertSame(time(), $dt->timestamp); - $this->assertSame('Europe/London', $dt->tzName); - } - - public function testToday() - { - $dt = Carbon::today(); - $this->assertSame(date('Y-m-d 00:00:00'), $dt->toDateTimeString()); - } - - public function testTodayWithTimezone() - { - $dt = Carbon::today('Europe/London'); - $dt2 = new \DateTime('now', new \DateTimeZone('Europe/London')); - $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); - } - - public function testTomorrow() - { - $dt = Carbon::tomorrow(); - $dt2 = new \DateTime('tomorrow'); - $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); - } - - public function testTomorrowWithTimezone() - { - $dt = Carbon::tomorrow('Europe/London'); - $dt2 = new \DateTime('tomorrow', new \DateTimeZone('Europe/London')); - $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); - } - - public function testYesterday() - { - $dt = Carbon::yesterday(); - $dt2 = new \DateTime('yesterday'); - $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); - } - - public function testYesterdayWithTimezone() - { - $dt = Carbon::yesterday('Europe/London'); - $dt2 = new \DateTime('yesterday', new \DateTimeZone('Europe/London')); - $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString()); - } - - public function testMinValue() - { - $this->assertLessThanOrEqual(- 2147483647, Carbon::minValue()->getTimestamp()); - } - - public function testMaxValue() - { - $this->assertGreaterThanOrEqual(2147483647, Carbon::maxValue()->getTimestamp()); - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/RelativeTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/RelativeTest.php b/vendor/nesbot/carbon/tests/RelativeTest.php deleted file mode 100644 index 1e0993c..0000000 --- a/vendor/nesbot/carbon/tests/RelativeTest.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class RelativeTest extends TestFixture -{ - public function testSecondsSinceMidnight() - { - $d = Carbon::today()->addSeconds(30); - $this->assertSame(30, $d->secondsSinceMidnight()); - - $d = Carbon::today()->addDays(1); - $this->assertSame(0, $d->secondsSinceMidnight()); - - $d = Carbon::today()->addDays(1)->addSeconds(120); - $this->assertSame(120, $d->secondsSinceMidnight()); - - $d = Carbon::today()->addMonths(3)->addSeconds(42); - $this->assertSame(42, $d->secondsSinceMidnight()); - } - - public function testSecondsUntilEndOfDay() - { - $d = Carbon::today()->endOfDay(); - $this->assertSame(0, $d->secondsUntilEndOfDay()); - - $d = Carbon::today()->endOfDay()->subSeconds(60); - $this->assertSame(60, $d->secondsUntilEndOfDay()); - - $d = Carbon::create(2014, 10, 24, 12, 34, 56); - $this->assertSame(41103, $d->secondsUntilEndOfDay()); - - $d = Carbon::create(2014, 10, 24, 0, 0, 0); - $this->assertSame(86399, $d->secondsUntilEndOfDay()); - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/SettersTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/SettersTest.php b/vendor/nesbot/carbon/tests/SettersTest.php deleted file mode 100644 index 54f5f5a..0000000 --- a/vendor/nesbot/carbon/tests/SettersTest.php +++ /dev/null @@ -1,253 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class SettersTest extends TestFixture -{ - public function testYearSetter() - { - $d = Carbon::now(); - $d->year = 1995; - $this->assertSame(1995, $d->year); - } - - public function testMonthSetter() - { - $d = Carbon::now(); - $d->month = 3; - $this->assertSame(3, $d->month); - } - - public function testMonthSetterWithWrap() - { - $d = Carbon::now(); - $d->month = 13; - $this->assertSame(1, $d->month); - } - - public function testDaySetter() - { - $d = Carbon::now(); - $d->day = 2; - $this->assertSame(2, $d->day); - } - - public function testDaySetterWithWrap() - { - $d = Carbon::createFromDate(2012, 8, 5); - $d->day = 32; - $this->assertSame(1, $d->day); - } - - public function testHourSetter() - { - $d = Carbon::now(); - $d->hour = 2; - $this->assertSame(2, $d->hour); - } - - public function testHourSetterWithWrap() - { - $d = Carbon::now(); - $d->hour = 25; - $this->assertSame(1, $d->hour); - } - - public function testMinuteSetter() - { - $d = Carbon::now(); - $d->minute = 2; - $this->assertSame(2, $d->minute); - } - - public function testMinuteSetterWithWrap() - { - $d = Carbon::now(); - $d->minute = 65; - $this->assertSame(5, $d->minute); - } - - public function testSecondSetter() - { - $d = Carbon::now(); - $d->second = 2; - $this->assertSame(2, $d->second); - } - - public function testTimeSetter() - { - $d = Carbon::now(); - $d->setTime(1, 1, 1); - $this->assertSame(1, $d->second); - $d->setTime(1, 1); - $this->assertSame(0, $d->second); - } - - public function testTimeSetterWithChaining() - { - $d = Carbon::now(); - $d->setTime(2, 2, 2)->setTime(1, 1, 1); - $this->assertInstanceOf('Carbon\Carbon', $d); - $this->assertSame(1, $d->second); - $d->setTime(2, 2, 2)->setTime(1, 1); - $this->assertInstanceOf('Carbon\Carbon', $d); - $this->assertSame(0, $d->second); - } - - public function testTimeSetterWithZero() - { - $d = Carbon::now(); - $d->setTime(1, 1); - $this->assertSame(0, $d->second); - } - - public function testDateTimeSetter() - { - $d = Carbon::now(); - $d->setDateTime($d->year, $d->month, $d->day, 1, 1, 1); - $this->assertSame(1, $d->second); - } - - public function testDateTimeSetterWithZero() - { - $d = Carbon::now(); - $d->setDateTime($d->year, $d->month, $d->day, 1, 1); - $this->assertSame(0, $d->second); - } - - public function testDateTimeSetterWithChaining() - { - $d = Carbon::now(); - $d->setDateTime(2013, 9, 24, 17, 4, 29); - $this->assertInstanceOf('Carbon\Carbon', $d); - $d->setDateTime(2014, 10, 25, 18, 5, 30); - $this->assertInstanceOf('Carbon\Carbon', $d); - $this->assertCarbon($d, 2014, 10, 25, 18, 5, 30); - } - - public function testSecondSetterWithWrap() - { - $d = Carbon::now(); - $d->second = 65; - $this->assertSame(5, $d->second); - } - - public function testTimestampSetter() - { - $d = Carbon::now(); - $d->timestamp = 10; - $this->assertSame(10, $d->timestamp); - - $d->setTimestamp(11); - $this->assertSame(11, $d->timestamp); - } - - public function testSetTimezoneWithInvalidTimezone() - { - $this->setExpectedException('InvalidArgumentException'); - $d = Carbon::now(); - $d->setTimezone('sdf'); - } - - public function testTimezoneWithInvalidTimezone() - { - $d = Carbon::now(); - - try { - $d->timezone = 'sdf'; - $this->fail('InvalidArgumentException was not been raised.'); - } catch (InvalidArgumentException $expected) { - } - - try { - $d->timezone('sdf'); - $this->fail('InvalidArgumentException was not been raised.'); - } catch (InvalidArgumentException $expected) { - } - } - public function testTzWithInvalidTimezone() - { - $d = Carbon::now(); - - try { - $d->tz = 'sdf'; - $this->fail('InvalidArgumentException was not been raised.'); - } catch (InvalidArgumentException $expected) { - } - - try { - $d->tz('sdf'); - $this->fail('InvalidArgumentException was not been raised.'); - } catch (InvalidArgumentException $expected) { - } - } - public function testSetTimezoneUsingString() - { - $d = Carbon::now(); - $d->setTimezone('America/Toronto'); - $this->assertSame('America/Toronto', $d->tzName); - } - - public function testTimezoneUsingString() - { - $d = Carbon::now(); - $d->timezone = 'America/Toronto'; - $this->assertSame('America/Toronto', $d->tzName); - - $d->timezone('America/Vancouver'); - $this->assertSame('America/Vancouver', $d->tzName); - } - - public function testTzUsingString() - { - $d = Carbon::now(); - $d->tz = 'America/Toronto'; - $this->assertSame('America/Toronto', $d->tzName); - - $d->tz('America/Vancouver'); - $this->assertSame('America/Vancouver', $d->tzName); - } - - public function testSetTimezoneUsingDateTimeZone() - { - $d = Carbon::now(); - $d->setTimezone(new \DateTimeZone('America/Toronto')); - $this->assertSame('America/Toronto', $d->tzName); - } - - public function testTimezoneUsingDateTimeZone() - { - $d = Carbon::now(); - $d->timezone = new \DateTimeZone('America/Toronto'); - $this->assertSame('America/Toronto', $d->tzName); - - $d->timezone(new \DateTimeZone('America/Vancouver')); - $this->assertSame('America/Vancouver', $d->tzName); - } - - public function testTzUsingDateTimeZone() - { - $d = Carbon::now(); - $d->tz = new \DateTimeZone('America/Toronto'); - $this->assertSame('America/Toronto', $d->tzName); - - $d->tz(new \DateTimeZone('America/Vancouver')); - $this->assertSame('America/Vancouver', $d->tzName); - } - - public function testInvalidSetter() - { - $this->setExpectedException('InvalidArgumentException'); - $d = Carbon::now(); - $d->doesNotExit = 'bb'; - } -} http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/80fd786e/vendor/nesbot/carbon/tests/StartEndOfTest.php ---------------------------------------------------------------------- diff --git a/vendor/nesbot/carbon/tests/StartEndOfTest.php b/vendor/nesbot/carbon/tests/StartEndOfTest.php deleted file mode 100644 index e72ebed..0000000 --- a/vendor/nesbot/carbon/tests/StartEndOfTest.php +++ /dev/null @@ -1,236 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Carbon\Carbon; - -class StartEndOfTest extends TestFixture -{ - public function testStartOfDay() - { - $dt = Carbon::now(); - $this->assertTrue($dt->startOfDay() instanceof Carbon); - $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, 0, 0, 0); - } - - public function testEndOfDay() - { - $dt = Carbon::now(); - $this->assertTrue($dt->endOfDay() instanceof Carbon); - $this->assertCarbon($dt, $dt->year, $dt->month, $dt->day, 23, 59, 59); - } - - public function testStartOfMonthIsFluid() - { - $dt = Carbon::now(); - $this->assertTrue($dt->startOfMonth() instanceof Carbon); - } - - public function testStartOfMonthFromNow() - { - $dt = Carbon::now()->startOfMonth(); - $this->assertCarbon($dt, $dt->year, $dt->month, 1, 0, 0, 0); - } - - public function testStartOfMonthFromLastDay() - { - $dt = Carbon::create(2000, 1, 31, 2, 3, 4)->startOfMonth(); - $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); - } - - public function testStartOfYearIsFluid() - { - $dt = Carbon::now(); - $this->assertTrue($dt->startOfYear() instanceof Carbon); - } - - public function testStartOfYearFromNow() - { - $dt = Carbon::now()->startOfYear(); - $this->assertCarbon($dt, $dt->year, 1, 1, 0, 0, 0); - } - - public function testStartOfYearFromFirstDay() - { - $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->startOfYear(); - $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); - } - - public function testStartOfYearFromLastDay() - { - $dt = Carbon::create(2000, 12, 31, 23, 59, 59)->startOfYear(); - $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); - } - - public function testEndOfMonthIsFluid() - { - $dt = Carbon::now(); - $this->assertTrue($dt->endOfMonth() instanceof Carbon); - } - - public function testEndOfMonth() - { - $dt = Carbon::create(2000, 1, 1, 2, 3, 4)->endOfMonth(); - $this->assertCarbon($dt, 2000, 1, 31, 23, 59, 59); - } - - public function testEndOfMonthFromLastDay() - { - $dt = Carbon::create(2000, 1, 31, 2, 3, 4)->endOfMonth(); - $this->assertCarbon($dt, 2000, 1, 31, 23, 59, 59); - } - - public function testEndOfYearIsFluid() - { - $dt = Carbon::now(); - $this->assertTrue($dt->endOfYear() instanceof Carbon); - } - - public function testEndOfYearFromNow() - { - $dt = Carbon::now()->endOfYear(); - $this->assertCarbon($dt, $dt->year, 12, 31, 23, 59, 59); - } - - public function testEndOfYearFromFirstDay() - { - $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->endOfYear(); - $this->assertCarbon($dt, 2000, 12, 31, 23, 59, 59); - } - - public function testEndOfYearFromLastDay() - { - $dt = Carbon::create(2000, 12, 31, 23, 59, 59)->endOfYear(); - $this->assertCarbon($dt, 2000, 12, 31, 23, 59, 59); - } - - public function testStartOfDecadeIsFluid() - { - $dt = Carbon::now(); - $this->assertTrue($dt->startOfDecade() instanceof Carbon); - } - - public function testStartOfDecadeFromNow() - { - $dt = Carbon::now()->startOfDecade(); - $this->assertCarbon($dt, $dt->year - $dt->year % 10, 1, 1, 0, 0, 0); - } - - public function testStartOfDecadeFromFirstDay() - { - $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->startOfDecade(); - $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); - } - - public function testStartOfDecadeFromLastDay() - { - $dt = Carbon::create(2009, 12, 31, 23, 59, 59)->startOfDecade(); - $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); - } - - public function testEndOfDecadeIsFluid() - { - $dt = Carbon::now(); - $this->assertTrue($dt->endOfDecade() instanceof Carbon); - } - - public function testEndOfDecadeFromNow() - { - $dt = Carbon::now()->endOfDecade(); - $this->assertCarbon($dt, $dt->year - $dt->year % 10 + 9, 12, 31, 23, 59, 59); - } - - public function testEndOfDecadeFromFirstDay() - { - $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->endOfDecade(); - $this->assertCarbon($dt, 2009, 12, 31, 23, 59, 59); - } - - public function testEndOfDecadeFromLastDay() - { - $dt = Carbon::create(2009, 12, 31, 23, 59, 59)->endOfDecade(); - $this->assertCarbon($dt, 2009, 12, 31, 23, 59, 59); - } - - public function testStartOfCenturyIsFluid() - { - $dt = Carbon::now(); - $this->assertTrue($dt->startOfCentury() instanceof Carbon); - } - - public function testStartOfCenturyFromNow() - { - $dt = Carbon::now()->startOfCentury(); - $this->assertCarbon($dt, $dt->year - $dt->year % 100, 1, 1, 0, 0, 0); - } - - public function testStartOfCenturyFromFirstDay() - { - $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->startOfCentury(); - $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); - } - - public function testStartOfCenturyFromLastDay() - { - $dt = Carbon::create(2009, 12, 31, 23, 59, 59)->startOfCentury(); - $this->assertCarbon($dt, 2000, 1, 1, 0, 0, 0); - } - - public function testEndOfCenturyIsFluid() - { - $dt = Carbon::now(); - $this->assertTrue($dt->endOfCentury() instanceof Carbon); - } - - public function testEndOfCenturyFromNow() - { - $dt = Carbon::now()->endOfCentury(); - $this->assertCarbon($dt, $dt->year - $dt->year % 100 + 99, 12, 31, 23, 59, 59); - } - - public function testEndOfCenturyFromFirstDay() - { - $dt = Carbon::create(2000, 1, 1, 1, 1, 1)->endOfCentury(); - $this->assertCarbon($dt, 2099, 12, 31, 23, 59, 59); - } - - public function testEndOfCenturyFromLastDay() - { - $dt = Carbon::create(2099, 12, 31, 23, 59, 59)->endOfCentury(); - $this->assertCarbon($dt, 2099, 12, 31, 23, 59, 59); - } - - public function testAverageIsFluid() - { - $dt = Carbon::now()->average(); - $this->assertTrue($dt instanceof Carbon); - } - - public function testAverageFromSame() - { - $dt1 = Carbon::create(2000, 1, 31, 2, 3, 4); - $dt2 = Carbon::create(2000, 1, 31, 2, 3, 4)->average($dt1); - $this->assertCarbon($dt2, 2000, 1, 31, 2, 3, 4); - } - - public function testAverageFromGreater() - { - $dt1 = Carbon::create(2000, 1, 1, 1, 1, 1); - $dt2 = Carbon::create(2009, 12, 31, 23, 59, 59)->average($dt1); - $this->assertCarbon($dt2, 2004, 12, 31, 12, 30, 30); - } - - public function testAverageFromLower() - { - $dt1 = Carbon::create(2009, 12, 31, 23, 59, 59); - $dt2 = Carbon::create(2000, 1, 1, 1, 1, 1)->average($dt1); - $this->assertCarbon($dt2, 2004, 12, 31, 12, 30, 30); - } -}