mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
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:
@@ -457,7 +457,7 @@ final class FlasherBuilderTest extends TestCase
|
||||
|
||||
$stamps = [
|
||||
new PriorityStamp(1),
|
||||
new HopsStamp(0),
|
||||
new HopsStamp(2),
|
||||
];
|
||||
$builder->with($stamps);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user