File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -649,15 +649,12 @@ public function testCreateCollectionWithSchemaIndexes(): void
649649 ]),
650650 ];
651651
652- /**
653- * Update array length check to 255
654- */
655652 $ indexes = [
656653 new Document ([
657654 '$id ' => ID ::custom ('idx_cards ' ),
658655 'type ' => Database::INDEX_KEY ,
659656 'attributes ' => ['cards ' ],
660- 'lengths ' => [500 ],
657+ 'lengths ' => [500 ], // Will be changed to Database::ARRAY_INDEX_LENGTH (255)
661658 'orders ' => [Database::ORDER_DESC ],
662659 ]),
663660 new Document ([
@@ -686,10 +683,6 @@ public function testCreateCollectionWithSchemaIndexes(): void
686683 );
687684
688685 $ this ->assertEquals ($ collection ->getAttribute ('indexes ' )[0 ]['attributes ' ][0 ], 'cards ' );
689- /**
690- * If we set getMaxIndexLength to 1024 then this tests pass but other tests that depend on index length fail
691- */
692-
693686 $ this ->assertEquals ($ collection ->getAttribute ('indexes ' )[0 ]['lengths ' ][0 ], Database::ARRAY_INDEX_LENGTH );
694687 $ this ->assertEquals ($ collection ->getAttribute ('indexes ' )[0 ]['orders ' ][0 ], null );
695688
Original file line number Diff line number Diff line change @@ -1405,21 +1405,14 @@ public function testFindBasicChecks(): void
14051405 ]);
14061406 $ this ->assertEquals ($ firstDocumentId , $ documents [0 ]->getId ());
14071407
1408- /**
1408+ /**
14091409 * Check internal numeric ID sorting
14101410 */
14111411 $ documents = $ database ->find ('movies ' , [
14121412 Query::limit (25 ),
14131413 Query::offset (0 ),
14141414 Query::orderDesc ('' ),
14151415 ]);
1416-
1417- // foreach ($documents as $document) {
1418- // var_dump($document->getAttribute('name'));
1419- // }
1420- //
1421- // exit;
1422- //var_dump($movieDocuments);
14231416 $ this ->assertEquals ($ movieDocuments [\count ($ movieDocuments ) - 1 ]->getId (), $ documents [0 ]->getId ());
14241417 $ documents = $ database ->find ('movies ' , [
14251418 Query::limit (25 ),
@@ -1985,8 +1978,6 @@ public function testFindOrderByAfterNaturalOrder(): void
19851978 Query::orderDesc ('' ),
19861979 Query::cursorAfter ($ movies [1 ])
19871980 ]);
1988- //var_dump($movieDocuments);
1989-
19901981 $ this ->assertEquals (2 , count ($ documents ));
19911982 $ this ->assertEquals ($ movies [2 ]['name ' ], $ documents [0 ]['name ' ]);
19921983 $ this ->assertEquals ($ movies [3 ]['name ' ], $ documents [1 ]['name ' ]);
@@ -2016,7 +2007,6 @@ public function testFindOrderByAfterNaturalOrder(): void
20162007 Query::orderDesc ('' ),
20172008 Query::cursorAfter ($ movies [5 ])
20182009 ]);
2019-
20202010 $ this ->assertEmpty (count ($ documents ));
20212011 }
20222012 public function testFindOrderByBeforeNaturalOrder (): void
Original file line number Diff line number Diff line change @@ -120,9 +120,6 @@ public function testPreserveDatesUpdate(): void
120120 'attr1 ' => 'value3 ' ,
121121 ]));
122122
123-
124-
125-
126123 $ newDate = '2000-01-01T10:00:00.000+00:00 ' ;
127124
128125 $ doc1 ->setAttribute ('$updatedAt ' , $ newDate );
@@ -131,16 +128,12 @@ public function testPreserveDatesUpdate(): void
131128 $ doc1 = $ database ->getDocument ('preserve_update_dates ' , 'doc1 ' );
132129 $ this ->assertEquals ($ newDate , $ doc1 ->getAttribute ('$updatedAt ' ));
133130
134- // var_dump([
135- // '$doc2' => $doc2->getAttribute('$updatedAt'),
136- // '$doc3' => $doc3->getAttribute('$updatedAt'),
137- // ]);
138-
139131 $ this ->getDatabase ()->updateDocuments (
140132 'preserve_update_dates ' ,
141133 new Document ([
142134 '$updatedAt ' => $ newDate
143- ]), [
135+ ]),
136+ [
144137 Query::equal ('$id ' , [
145138 $ doc2 ->getId (),
146139 $ doc3 ->getId ()
You can’t perform that action at this time.
0 commit comments