Skip to content

Commit 4e97346

Browse files
committed
fix: unit tests for MongoDB
1 parent 7e83545 commit 4e97346

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed

tests/Bridge/Doctrine/MongoDbOdm/Filter/SearchFilterTest.php

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,36 @@ public function provideApplyTestData(): array
395395
],
396396
$filterFactory,
397397
],
398+
'partial (multiple values)' => [
399+
[
400+
[
401+
'$match' => [
402+
'name' => [
403+
'$in' => [
404+
new Regex('CaSE'),
405+
new Regex('SENSitive'),
406+
],
407+
],
408+
],
409+
],
410+
],
411+
$filterFactory,
412+
],
413+
'partial (multiple values; case insensitive)' => [
414+
[
415+
[
416+
'$match' => [
417+
'name' => [
418+
'$in' => [
419+
new Regex('CaSE', 'i'),
420+
new Regex('inSENSitive', 'i'),
421+
],
422+
],
423+
],
424+
],
425+
],
426+
$filterFactory,
427+
],
398428
'start' => [
399429
[
400430
[
@@ -423,6 +453,36 @@ public function provideApplyTestData(): array
423453
],
424454
$filterFactory,
425455
],
456+
'start (multiple values)' => [
457+
[
458+
[
459+
'$match' => [
460+
'name' => [
461+
'$in' => [
462+
new Regex('^CaSE'),
463+
new Regex('^SENSitive'),
464+
],
465+
],
466+
],
467+
],
468+
],
469+
$filterFactory,
470+
],
471+
'start (multiple values; case insensitive)' => [
472+
[
473+
[
474+
'$match' => [
475+
'name' => [
476+
'$in' => [
477+
new Regex('^CaSE', 'i'),
478+
new Regex('^inSENSitive', 'i'),
479+
],
480+
],
481+
],
482+
],
483+
],
484+
$filterFactory,
485+
],
426486
'end' => [
427487
[
428488
[
@@ -451,6 +511,36 @@ public function provideApplyTestData(): array
451511
],
452512
$filterFactory,
453513
],
514+
'end (multiple values)' => [
515+
[
516+
[
517+
'$match' => [
518+
'name' => [
519+
'$in' => [
520+
new Regex('CaSE$'),
521+
new Regex('SENSitive$'),
522+
],
523+
],
524+
],
525+
],
526+
],
527+
$filterFactory,
528+
],
529+
'end (multiple values; case insensitive)' => [
530+
[
531+
[
532+
'$match' => [
533+
'name' => [
534+
'$in' => [
535+
new Regex('CaSE$', 'i'),
536+
new Regex('inSENSitive$', 'i'),
537+
],
538+
],
539+
],
540+
],
541+
],
542+
$filterFactory,
543+
],
454544
'word_start' => [
455545
[
456546
[
@@ -479,6 +569,36 @@ public function provideApplyTestData(): array
479569
],
480570
$filterFactory,
481571
],
572+
'word_start (multiple values)' => [
573+
[
574+
[
575+
'$match' => [
576+
'name' => [
577+
'$in' => [
578+
new Regex('(^CaSE.*|.*\sCaSE.*)'),
579+
new Regex('(^SENSitive.*|.*\sSENSitive.*)'),
580+
],
581+
],
582+
],
583+
],
584+
],
585+
$filterFactory,
586+
],
587+
'word_start (multiple values; case insensitive)' => [
588+
[
589+
[
590+
'$match' => [
591+
'name' => [
592+
'$in' => [
593+
new Regex('(^CaSE.*|.*\sCaSE.*)', 'i'),
594+
new Regex('(^inSENSitive.*|.*\sinSENSitive.*)', 'i'),
595+
],
596+
],
597+
],
598+
],
599+
],
600+
$filterFactory,
601+
],
482602
'invalid value for relation' => [
483603
[],
484604
$filterFactory,

0 commit comments

Comments
 (0)