Completed
Push — master ( 5e74f9...02f1fa )
by
unknown
163:08 queued 62:37
created

OptionsTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

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
 * @author Virchenko Maksim <[email protected]>
11
 * @package SfCod\QueueBundle\Tests\Worker
12
 */
13
class OptionsTest extends TestCase
14
{
15
    /**
16
     * Test worker options
17
     */
18
    public function testOptions()
19
    {
20
        $delay = rand(1, 100);
21
        $memory = rand(128, 2048);
22
        $timeout = rand(60, 3600);
23
        $sleep = rand(0, 60);
24
        $maxTries = rand(1, 10);
25
        $force = (bool)rand(0, 1);
26
27
        $options = new Options($delay, $memory, $timeout, $sleep, $maxTries, $force);
28
29
        $this->assertEquals($delay, $options->delay);
30
        $this->assertEquals($memory, $options->memory);
31
        $this->assertEquals($timeout, $options->timeout);
32
        $this->assertEquals($sleep, $options->sleep);
33
        $this->assertEquals($maxTries, $options->maxTries);
34
        $this->assertEquals($force, $options->force);
35
    }
36
}