RangeTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testUnsupportedRange() 0 5 1
A testSupportedRange() 0 9 1
1
<?php
2
3
namespace Spiral\Tests\Statistics\Extract;
4
5
use Spiral\Statistics\Extract\Range;
6
use Spiral\Tests\BaseTest;
7
8
class RangeTest extends BaseTest
9
{
10
    /**
11
     * Test unsupported range interval
12
     *
13
     * @expectedException \Spiral\Statistics\Exceptions\InvalidExtractRangeException
14
     */
15
    public function testUnsupportedRange()
16
    {
17
        $range = new Range('abc');
18
        $this->assertEquals($range->getRange(), 'abc');
19
    }
20
21
    /**
22
     * Test supported range interval
23
     */
24
    public function testSupportedRange()
25
    {
26
        $input = Range::DAILY;
27
        $range = new Range($input);
28
        $this->assertEquals($range->getRange(), $input);
29
        $this->assertNotEmpty($range->getFormat());
30
        $this->assertNotEmpty($range->getField());
31
        $this->assertNotEmpty($range->getInterval());
32
    }
33
}