Skip to content

Commit 87245a8

Browse files
committed
tests improved for uuid for point
1 parent 35c1357 commit 87245a8

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

tests/Unit/Models/PointStructTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ public function testPointStruct(): void
2626
);
2727
}
2828

29+
public function testPointStructWithUUid(): void
30+
{
31+
$point = new PointStruct('550e8400-e29b-41d4-a716-446655440000', new VectorStruct([1, 2, 3]));
32+
33+
$this->assertEquals(
34+
[
35+
'id' => '550e8400-e29b-41d4-a716-446655440000',
36+
'vector' => [1, 2, 3]
37+
],
38+
$point->toArray()
39+
);
40+
}
41+
2942
public function testPointStructWithArray(): void
3043
{
3144
$points = PointStruct::createFromArray([

tests/Unit/Models/PointsStructTest.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,27 @@ public function testPointsStruct(): void
3434
);
3535
}
3636

37+
public function testPointsStructWithUUid(): void
38+
{
39+
$points = new PointsStruct();
40+
$points->addPoint(
41+
new PointStruct(
42+
'550e8400-e29b-41d4-a716-446655440000',
43+
new VectorStruct([1, 2, 3])
44+
)
45+
);
46+
47+
$this->assertEquals(
48+
[
49+
[
50+
'id' => '550e8400-e29b-41d4-a716-446655440000',
51+
'vector' => [1, 2, 3]
52+
]
53+
],
54+
$points->toArray()
55+
);
56+
}
57+
3758
public function testPointsStructWithArray(): void
3859
{
3960
$points = PointsStruct::createFromArray([
@@ -64,7 +85,7 @@ public function testPointsStructWithNamedVectors(): void
6485
],
6586
],
6687
[
67-
'id' => 1,
88+
'id' => '550e8400-e29b-41d4-a716-446655440000',
6889
'vector' => [
6990
'image' => [3, 4, 5]
7091
],
@@ -80,7 +101,7 @@ public function testPointsStructWithNamedVectors(): void
80101
],
81102
],
82103
[
83-
'id' => 1,
104+
'id' => '550e8400-e29b-41d4-a716-446655440000',
84105
'vector' => [
85106
'image' => [3, 4, 5]
86107
],

0 commit comments

Comments
 (0)