OptionsTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testOptions() 0 18 1
1
<?php
2
3
namespace SfCod\QueueBundle\Tests\Worker;
4
5
use PHPUnit\Framework\TestCase;
6
use SfCod\QueueBundle\Worker\Options;
7
8
/**
9
 * Class OptionsTest
10
 *
11
 * @author Virchenko Maksim <[email protected]>
12
 *
13
 * @package SfCod\QueueBundle\Tests\Worker
14
 */
15
class OptionsTest extends TestCase
16
{
17
    /**
18
     * Test worker options
19
     */
20
    public function testOptions()
21
    {
22
        $delay = rand(1, 100);
23
        $memory = rand(128, 2048);
24
        $timeout = rand(60, 3600);
25
        $sleep = rand(0, 60);
26
        $maxTries = rand(1, 10);
27
        $force = (bool)rand(0, 1);
28
29
        $options = new Options($delay, $memory, $timeout, $sleep, $maxTries, $force);
30
31
        $this->assertEquals($delay, $options->delay);
32
        $this->assertEquals($memory, $options->memory);
33
        $this->assertEquals($timeout, $options->timeout);
34
        $this->assertEquals($sleep, $options->sleep);
35
        $this->assertEquals($maxTries, $options->maxTries);
36
        $this->assertEquals($force, $options->force);
37
    }
38
}
39