MCPcopy Create free account
hub / github.com/taskforcesh/bullmq / testBackoffNormalization

Method testBackoffNormalization

php/tests/JobOptionsTest.php:55–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53 }
54
55 public function testBackoffNormalization(): void
56 {
57 // Integer backoff
58 $options = JobOptions::fromArray([
59 'backoff' => 1000,
60 ]);
61
62 $array = $options->toArray();
63 $this->assertEquals(['type' => 'fixed', 'delay' => 1000], $array['backoff']);
64
65 // Array backoff
66 $options2 = JobOptions::fromArray([
67 'backoff' => ['type' => 'exponential', 'delay' => 2000],
68 ]);
69
70 $array2 = $options2->toArray();
71 $this->assertEquals(['type' => 'exponential', 'delay' => 2000], $array2['backoff']);
72 }
73
74 public function testRemoveOnCompleteOptions(): void
75 {

Callers

nothing calls this directly

Calls 2

fromArrayMethod · 0.80
toArrayMethod · 0.80

Tested by

no test coverage detected