File tree Expand file tree Collapse file tree
tests/Unit/Models/Request Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * @since Mar 2023
4+ * @author Haydar KULEKCI <haydarkulekci@gmail.com>
5+ */
6+
7+ namespace Qdrant \Tests \Unit \Models \Request ;
8+
9+ use PHPUnit \Framework \TestCase ;
10+ use Qdrant \Models \Request \Point ;
11+ use Qdrant \Models \VectorStruct ;
12+
13+ class PointTest extends TestCase
14+ {
15+ public function testValidBasic (): void
16+ {
17+ $ point = new Point (
18+ '1 ' ,
19+ new VectorStruct ([1 , 2 , 3 ])
20+ );
21+
22+ $ this ->assertEquals ([
23+ 'id ' => '1 ' ,
24+ 'vector ' => [1 , 2 , 3 ]
25+ ], $ point ->toArray ());
26+ }
27+
28+ public function testValidBasicWithArrayVector (): void
29+ {
30+ $ point = new Point (
31+ '1 ' ,
32+ [1 , 2 , 3 ]
33+ );
34+
35+ $ this ->assertEquals ([
36+ 'id ' => '1 ' ,
37+ 'vector ' => [1 , 2 , 3 ]
38+ ], $ point ->toArray ());
39+ }
40+
41+ public function testValidBasicWithPayload (): void
42+ {
43+ $ point = new Point (
44+ '1 ' ,
45+ [1 , 2 , 3 ],
46+ ['foo ' => 'bar ' ]
47+ );
48+
49+ $ this ->assertEquals ([
50+ 'id ' => '1 ' ,
51+ 'vector ' => [1 , 2 , 3 ],
52+ 'payload ' => ['foo ' => 'bar ' ]
53+ ], $ point ->toArray ());
54+ }
55+ }
You can’t perform that action at this time.
0 commit comments