File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -629,8 +629,17 @@ public function testSetValues(): void
629
629
630
630
$ templateProcessor = new TestableTemplateProcesor ($ mainPart );
631
631
$ templateProcessor ->setValues (['firstname ' => 'John ' , 'lastname ' => 'Doe ' ]);
632
-
633
632
self ::assertStringContainsString ('Hello John Doe ' , $ templateProcessor ->getMainPart ());
633
+
634
+ // test with a specific limit that is lower than the number of replacements
635
+ $ templateProcessor = new TestableTemplateProcesor ($ mainPart );
636
+ $ templateProcessor ->setValues (['firstname ' => 'Jane ' , 'lastname ' => 'Smith ' ], 2 );
637
+ self ::assertStringContainsString ('Hello Jane Smith ' , $ templateProcessor ->getMainPart ());
638
+
639
+ // test with a limit for only one replacement
640
+ $ templateProcessor = new TestableTemplateProcesor ($ mainPart );
641
+ $ templateProcessor ->setValues (['firstname ' => 'Alice ' , 'lastname ' => 'Wonderland ' ], 1 );
642
+ self ::assertStringContainsString ('Hello Alice Wonderland ' , $ templateProcessor ->getMainPart ());
634
643
}
635
644
636
645
/**
You can’t perform that action at this time.
0 commit comments