Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /* * This file is part of the Carbon package. * * (c) Brian Nesbitt <brian@nesbo..
Decoded Output download
<?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\Localization;
use Carbon\Carbon;
use Tests\AbstractTestCase;
class RoTest extends AbstractTestCase
{
public function testDiffForHumansLocalizedInRomanian()
{
Carbon::setLocale('ro');
$scope = $this;
$this->wrapWithNonDstDate(function () use ($scope) {
$d = Carbon::now()->subSeconds(1);
$scope->assertSame('acum o secund', $d->diffForHumans());
$d = Carbon::now()->subSeconds(2);
$scope->assertSame('acum 2 secunde', $d->diffForHumans());
$d = Carbon::now()->subMinutes(1);
$scope->assertSame('acum un minut', $d->diffForHumans());
$d = Carbon::now()->subMinutes(2);
$scope->assertSame('acum 2 minute', $d->diffForHumans());
$d = Carbon::now()->subHours(1);
$scope->assertSame('acum o or', $d->diffForHumans());
$d = Carbon::now()->subHours(2);
$scope->assertSame('acum 2 ore', $d->diffForHumans());
$d = Carbon::now()->subDays(1);
$scope->assertSame('acum o zi', $d->diffForHumans());
$d = Carbon::now()->subDays(2);
$scope->assertSame('acum 2 zile', $d->diffForHumans());
$d = Carbon::now()->subWeeks(1);
$scope->assertSame('acum o sptmn', $d->diffForHumans());
$d = Carbon::now()->subWeeks(2);
$scope->assertSame('acum 2 sptmni', $d->diffForHumans());
$d = Carbon::now()->subMonths(1);
$scope->assertSame('acum o lun', $d->diffForHumans());
$d = Carbon::now()->subMonths(2);
$scope->assertSame('acum 2 luni', $d->diffForHumans());
$d = Carbon::now()->subYears(1);
$scope->assertSame('acum un an', $d->diffForHumans());
$d = Carbon::now()->subYears(2);
$scope->assertSame('acum 2 ani', $d->diffForHumans());
$d = Carbon::now()->addSecond();
$scope->assertSame('o secund de acum', $d->diffForHumans());
$d = Carbon::now()->addSecond();
$d2 = Carbon::now();
$scope->assertSame('peste o secund', $d->diffForHumans($d2));
$scope->assertSame('acum o secund', $d2->diffForHumans($d));
$scope->assertSame('o secund', $d->diffForHumans($d2, true));
$scope->assertSame('2 secunde', $d2->diffForHumans($d->addSecond(), true));
});
}
}
?>
Did this file decode correctly?
Original Code
<?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\Localization;
use Carbon\Carbon;
use Tests\AbstractTestCase;
class RoTest extends AbstractTestCase
{
public function testDiffForHumansLocalizedInRomanian()
{
Carbon::setLocale('ro');
$scope = $this;
$this->wrapWithNonDstDate(function () use ($scope) {
$d = Carbon::now()->subSeconds(1);
$scope->assertSame('acum o secund', $d->diffForHumans());
$d = Carbon::now()->subSeconds(2);
$scope->assertSame('acum 2 secunde', $d->diffForHumans());
$d = Carbon::now()->subMinutes(1);
$scope->assertSame('acum un minut', $d->diffForHumans());
$d = Carbon::now()->subMinutes(2);
$scope->assertSame('acum 2 minute', $d->diffForHumans());
$d = Carbon::now()->subHours(1);
$scope->assertSame('acum o or', $d->diffForHumans());
$d = Carbon::now()->subHours(2);
$scope->assertSame('acum 2 ore', $d->diffForHumans());
$d = Carbon::now()->subDays(1);
$scope->assertSame('acum o zi', $d->diffForHumans());
$d = Carbon::now()->subDays(2);
$scope->assertSame('acum 2 zile', $d->diffForHumans());
$d = Carbon::now()->subWeeks(1);
$scope->assertSame('acum o sptmn', $d->diffForHumans());
$d = Carbon::now()->subWeeks(2);
$scope->assertSame('acum 2 sptmni', $d->diffForHumans());
$d = Carbon::now()->subMonths(1);
$scope->assertSame('acum o lun', $d->diffForHumans());
$d = Carbon::now()->subMonths(2);
$scope->assertSame('acum 2 luni', $d->diffForHumans());
$d = Carbon::now()->subYears(1);
$scope->assertSame('acum un an', $d->diffForHumans());
$d = Carbon::now()->subYears(2);
$scope->assertSame('acum 2 ani', $d->diffForHumans());
$d = Carbon::now()->addSecond();
$scope->assertSame('o secund de acum', $d->diffForHumans());
$d = Carbon::now()->addSecond();
$d2 = Carbon::now();
$scope->assertSame('peste o secund', $d->diffForHumans($d2));
$scope->assertSame('acum o secund', $d2->diffForHumans($d));
$scope->assertSame('o secund', $d->diffForHumans($d2, true));
$scope->assertSame('2 secunde', $d2->diffForHumans($d->addSecond(), true));
});
}
}
Function Calls
None |
Stats
MD5 | 2e069c16c42e767c02875b54ffdbdeff |
Eval Count | 0 |
Decode Time | 87 ms |