-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathPollingOptionsTest.php
More file actions
36 lines (30 loc) · 1.21 KB
/
Copy pathPollingOptionsTest.php
File metadata and controls
36 lines (30 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
namespace ClientOptions;
use Mindee\ClientOptions\PollingOptions;
use PHPUnit\Framework\TestCase;
class PollingOptionsTest extends TestCase
{
public function testConstructorNoArguments(): void
{
$pollingOptions = new PollingOptions();
self::assertEquals(80, $pollingOptions->maxRetries);
self::assertEquals(1.5, $pollingOptions->delaySec);
self::assertEquals(2, $pollingOptions->initialDelaySec);
}
public function testConstructorSomeArguments(): void
{
$pollingOptions = new PollingOptions(maxRetries: 100);
self::assertEquals(100, $pollingOptions->maxRetries);
self::assertEquals(1.5, $pollingOptions->delaySec);
self::assertEquals(2, $pollingOptions->initialDelaySec);
}
public function testConstructorAllArguments(): void
{
// voluntarily passing arguments in a different order than the constructor
$pollingOptions = new PollingOptions(delaySec: 3.0, maxRetries: 100, initialDelaySec: 10);
self::assertEquals(100, $pollingOptions->maxRetries);
self::assertEquals(3, $pollingOptions->delaySec);
self::assertEquals(10.0, $pollingOptions->initialDelaySec);
}
}