11<?php
22
3- use FiveamCode \LaravelNotionApi \Exceptions \HandlingException ;
43use FiveamCode \LaravelNotionApi \Query \Sorting ;
54use Illuminate \Support \Collection ;
65
76it ('can sort by a single property ' , function () {
87 $ expectedSortQuery = '[{"property":"Birth year","direction":"ascending"}] ' ;
98
10- $ sortBy = Sorting::propertySort ("Birth year " , "ascending " );
11- $ this ->assertEquals ($ expectedSortQuery , json_encode (Sorting::sortQuery ($ sortBy )));});
9+ $ sortBy = Sorting::propertySort ('Birth year ' , 'ascending ' );
10+ $ this ->assertEquals ($ expectedSortQuery , json_encode (Sorting::sortQuery ($ sortBy )));
11+ });
1212
1313it ('can sort by multiple properties ' , function () {
1414 $ expectedSortQuery = '[{"timestamp":"created_time","direction":"ascending"},{"property":"Birth year","direction":"ascending"}] ' ;
1515
1616 $ sortings = new Collection ();
1717
18- $ sortings ->add (Sorting::timestampSort (" created_time " , " ascending " ));
19- $ sortings ->add (Sorting::propertySort (" Birth year " , " ascending " ));
18+ $ sortings ->add (Sorting::timestampSort (' created_time ' , ' ascending ' ));
19+ $ sortings ->add (Sorting::propertySort (' Birth year ' , ' ascending ' ));
2020
2121 $ this ->assertEquals ($ expectedSortQuery , json_encode (Sorting::sortQuery ($ sortings )));
2222});
2727 Notion::database ('8284f3ff77e24d4a939d19459e4d6bdc ' )
2828 ->sortBy (new stdClass ())
2929 ->query ();
30- });
30+ });
0 commit comments