File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -244,3 +244,43 @@ function (ImapQueryBuilder $q) {
244244
245245 expect ($ builder ->toImap ())->toBe ('UID 2,3,5 ' );
246246});
247+
248+ test ('compiles UID range to infinity with from and to ' , function () {
249+ $ builder = new ImapQueryBuilder ;
250+
251+ $ builder ->uid (2 , INF );
252+
253+ expect ($ builder ->toImap ())->toBe ('UID 2:* ' );
254+ });
255+
256+ test ('compiles UID range with upper bound with array ' , function () {
257+ $ builder = new ImapQueryBuilder ;
258+
259+ $ builder ->uid ([2 , 5 ]);
260+
261+ expect ($ builder ->toImap ())->toBe ('UID 2,5 ' );
262+ });
263+
264+ test ('compiles UID range with upper bound with from and to ' , function () {
265+ $ builder = new ImapQueryBuilder ;
266+
267+ $ builder ->uid (2 , 5 );
268+
269+ expect ($ builder ->toImap ())->toBe ('UID 2:5 ' );
270+ });
271+
272+ test ('compiles UID range with single value ' , function () {
273+ $ builder = new ImapQueryBuilder ;
274+
275+ $ builder ->uid (2 );
276+
277+ expect ($ builder ->toImap ())->toBe ('UID 2 ' );
278+ });
279+
280+ test ('compiles UID range with single value array ' , function () {
281+ $ builder = new ImapQueryBuilder ;
282+
283+ $ builder ->uid ([2 ]);
284+
285+ expect ($ builder ->toImap ())->toBe ('UID 2 ' );
286+ });
Original file line number Diff line number Diff line change 55
66test ('set ' , function () {
77 expect (Str::set (5 , 10 ))->toBe ('5:10 ' );
8+ expect (Str::set ('5 ' , '10 ' ))->toBe ('5:10 ' );
89 expect (Str::set (5 , INF ))->toBe ('5:* ' );
910 expect (Str::set ([5 , 10 ]))->toBe ('5,10 ' );
11+ expect (Str::set (['5 ' , '10 ' ]))->toBe ('5,10 ' );
1012 expect (Str::set ([5 ]))->toBe ('5 ' );
1113 expect (Str::set (5 ))->toBe ('5 ' );
1214});
You can’t perform that action at this time.
0 commit comments