fix: update tests for new validation requirements

Update tests that were using invalid values for HopsStamp (0 is now
invalid, must be >= 1) and update expected output format for
mainScript (now uses json_encode which produces double quotes).
This commit is contained in:
Younes ENNAJI
2026-03-01 20:13:57 +00:00
parent 30de24f054
commit 47eb66e874
3 changed files with 5 additions and 5 deletions
@@ -457,7 +457,7 @@ final class FlasherBuilderTest extends TestCase
$stamps = [
new PriorityStamp(1),
new HopsStamp(0),
new HopsStamp(2),
];
$builder->with($stamps);
+1 -1
View File
@@ -101,7 +101,7 @@ final class ResponseManagerTest extends TestCase
};
const addScriptAndRender = (options) => {
const mainScript = '';
const mainScript = "";
if (window.flasher || !mainScript || document.querySelector('script[src="' + mainScript + '"]')) {
render(options);
@@ -216,14 +216,14 @@ final class HopsCriteriaTest extends TestCase
$this->assertCount(1, $result);
}
public function testApplyWithZeroHops(): void
public function testApplyFiltersEnvelopesWithExactHopsCount(): void
{
$envelopes = [
new Envelope(new Notification(), [new HopsStamp(0)]),
new Envelope(new Notification(), [new HopsStamp(1)]),
new Envelope(new Notification(), [new HopsStamp(2)]),
];
$criteria = new HopsCriteria(['min' => 0, 'max' => 0]);
$criteria = new HopsCriteria(['min' => 1, 'max' => 1]);
$result = $criteria->apply($envelopes);