OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
kreait
/
clock
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:34:11 AM
rwxr-xr-x
📄
FrozenClockTest.php
660 bytes
08/12/2024 10:33:23 AM
rw-r--r--
📄
SystemClockTest.php
1.23 KB
08/12/2024 10:33:23 AM
rw-r--r--
Editing: FrozenClockTest.php
Close
<?php declare(strict_types=1); namespace Kreait\Tests\Clock; use DateTimeImmutable; use Kreait\Clock\FrozenClock; use PHPUnit\Framework\TestCase; use function random_int; /** * @internal */ final class FrozenClockTest extends TestCase { /** @test */ public function it_works() { $now = new DateTimeImmutable(); $then = $now->modify('+'. random_int(1, 10).' seconds'); $clock = new FrozenClock($now); $this->assertSame($now, $clock->now()); $clock->setTo($then); $this->assertNotSame($now, $clock->now()); $this->assertSame($then, $clock->now()); } }