-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUuidTest.php
42 lines (32 loc) · 923 Bytes
/
UuidTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace Tests\Unit;
use Eve\Uuid\Uuid;
use PHPUnit\Framework\TestCase;
class UuidTest extends TestCase
{
public function testFreezeWithoutFixedValue(): void
{
$uuid = Uuid::freeze();
self::assertSame($uuid, Uuid::generate());
Uuid::unfreeze();
self::assertNotSame($uuid, Uuid::generate());
}
public function testFreezeWithFixedValue(): void
{
Uuid::freeze('foo');
self::assertSame('foo', Uuid::generate());
Uuid::unfreeze();
self::assertNotSame('foo', Uuid::generate());
}
public function testHelperFunction(): void
{
$uuid = Uuid::freeze();
self::assertSame($uuid, uuid());
Uuid::unfreeze();
self::assertNotSame($uuid, uuid());
Uuid::freeze('foo');
self::assertSame('foo', uuid());
Uuid::unfreeze();
self::assertNotSame('foo', uuid());
}
}