pixelfed/tests/Unit/SnowflakeTest.php

18 lines
359 B
PHP
Raw Normal View History

2021-02-13 05:50:46 +00:00
<?php
namespace Tests\Unit;
use Tests\TestCase;
use App\Services\SnowflakeService;
2021-02-17 05:59:40 +00:00
class SnowflakeTest extends TestCase
2021-02-13 05:50:46 +00:00
{
/** @test */
public function snowflakeTest()
{
$expected = 266077397319815168;
$actual = SnowflakeService::byDate(now()->parse('2021-02-13T05:36:35+00:00'));
$this->assertEquals($expected, $actual);
}
}