|
@@ 16-26 (lines=11) @@
|
| 13 |
|
{ |
| 14 |
|
use DelayStrategyResolverTrait; |
| 15 |
|
|
| 16 |
|
public function testGetStrategy() |
| 17 |
|
{ |
| 18 |
|
$checkingQueueName = 'queue'; |
| 19 |
|
$strategiesByQueues = ['queue' => 'arithmetic_strategy_key']; |
| 20 |
|
|
| 21 |
|
$resolver = $this->createDelayStrategyResolver($strategiesByQueues); |
| 22 |
|
$strategy = $resolver->getStrategy($checkingQueueName); |
| 23 |
|
$this->assertInstanceOf(ArithmeticProgressionStrategy::class, $strategy); |
| 24 |
|
$this->assertAttributeEquals(100, 'startInterval', $strategy); |
| 25 |
|
$this->assertAttributeEquals(4, 'multiplier', $strategy); |
| 26 |
|
} |
| 27 |
|
|
| 28 |
|
public function testGetDefaultStrategy() |
| 29 |
|
{ |
|
@@ 28-38 (lines=11) @@
|
| 25 |
|
$this->assertAttributeEquals(4, 'multiplier', $strategy); |
| 26 |
|
} |
| 27 |
|
|
| 28 |
|
public function testGetDefaultStrategy() |
| 29 |
|
{ |
| 30 |
|
$checkingQueueName = 'queue'; |
| 31 |
|
$strategiesByQueues = []; |
| 32 |
|
|
| 33 |
|
$resolver = $this->createDelayStrategyResolver($strategiesByQueues); |
| 34 |
|
$strategy = $resolver->getStrategy($checkingQueueName); |
| 35 |
|
$this->assertInstanceOf(GeometricProgressionStrategy::class, $strategy); |
| 36 |
|
$this->assertAttributeEquals(60, 'startInterval', $strategy); |
| 37 |
|
$this->assertAttributeEquals(3, 'multiplier', $strategy); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
public function testFailGetDefaultStrategy() |
| 41 |
|
{ |