@@ -630,16 +630,25 @@ public function testSetValues(): void
630
630
$ templateProcessor = new TestableTemplateProcesor ($ mainPart );
631
631
$ templateProcessor ->setValues (['firstname ' => 'John ' , 'lastname ' => 'Doe ' ]);
632
632
self ::assertStringContainsString ('Hello John Doe ' , $ templateProcessor ->getMainPart ());
633
+ self ::assertStringNotContainsString ('Hello ${firstname} ${lastname} ' , $ templateProcessor ->getMainPart ());
633
634
634
635
// test with a specific limit that is lower than the number of replacements
635
636
$ templateProcessor = new TestableTemplateProcesor ($ mainPart );
636
637
$ templateProcessor ->setValues (['firstname ' => 'Jane ' , 'lastname ' => 'Smith ' ], 2 );
637
638
self ::assertStringContainsString ('Hello Jane Smith ' , $ templateProcessor ->getMainPart ());
639
+ self ::assertStringContainsString ('Hello ${firstname} ${lastname} ' , $ templateProcessor ->getMainPart ());
638
640
639
641
// test with a limit for only one replacement
640
642
$ templateProcessor = new TestableTemplateProcesor ($ mainPart );
641
643
$ templateProcessor ->setValues (['firstname ' => 'Alice ' , 'lastname ' => 'Wonderland ' ], 1 );
642
644
self ::assertStringContainsString ('Hello Alice Wonderland ' , $ templateProcessor ->getMainPart ());
645
+ self ::assertStringContainsString ('Hello ${firstname} ${lastname} ' , $ templateProcessor ->getMainPart ());
646
+
647
+ // Test with a limit of 0 for a result with no replacements
648
+ $ templateProcessor = new TestableTemplateProcesor ($ mainPart );
649
+ $ templateProcessor ->setValues (['firstname ' => 'Test ' , 'lastname ' => 'User ' ], 0 );
650
+ self ::assertStringContainsString ('Hello ${firstname} ${lastname} ' , $ templateProcessor ->getMainPart ());
651
+ self ::assertStringNotContainsString ('Hello Test User ' , $ templateProcessor ->getMainPart ());
643
652
}
644
653
645
654
/**
0 commit comments